]> git.openfl.eu Git - yampl.git/commitdiff
add container file and task.
authorFl_GUI <flor.guilini@hotmail.com>
Sun, 26 Jan 2025 12:06:21 +0000 (13:06 +0100)
committerFl_GUI <flor.guilini@hotmail.com>
Sun, 26 Jan 2025 12:40:26 +0000 (13:40 +0100)
Containerfile [new file with mode: 0644]
compose.yaml [new file with mode: 0644]
examples/toml/yampl.toml
main.go
out.html [deleted file]

diff --git a/Containerfile b/Containerfile
new file mode 100644 (file)
index 0000000..09bd2b5
--- /dev/null
@@ -0,0 +1,20 @@
+FROM docker.io/golang:1.23.5-alpine as build
+
+WORKDIR src/yampl
+COPY go.* .
+COPY *.go .
+RUN go mod tidy
+
+RUN go install -ldflags="-s"
+RUN pwd
+
+# run image
+FROM scratch as run
+
+EXPOSE 8080
+VOLUME ["/app/static", "/app/templates", "/app/toml"]
+
+WORKDIR /app
+COPY --from=build /go/bin/yampl /app/yampl
+ENTRYPOINT ["/app/yampl", "-static", "/app/static", "-templ", "/app/templates", "-toml"]
+CMD ["project.toml"]
diff --git a/compose.yaml b/compose.yaml
new file mode 100644 (file)
index 0000000..2b584ec
--- /dev/null
@@ -0,0 +1,21 @@
+version: '3'
+services:
+  yampl:
+    image: yampl
+    container_name: yampl
+    image: containers.openfl.eu/local/yampl:dev
+    build:
+      dockerfile: Containerfile
+    ports:
+      - "8080:8080"
+    volumes:
+      - static:/app/static
+      - templates:/app/templates
+      - toml:/app/toml
+    command:
+      /app/toml/yampl.toml
+
+volumes:
+  static:
+  templates:
+  toml:
index 25cce174b81bf6d1a0e567ad3ea0a00839fe12f2..36ea1ef0cc7605456cad43b82ef3669849ebd6b9 100644 (file)
@@ -37,7 +37,7 @@ description = '''
 set up a git page for yampl.
 '''
 type = "task"
-completed = false
+completed = true
 
 [[items]]
 name = "static links to details"
@@ -48,10 +48,18 @@ Figure out static routing, perhaps based on name.
 type = "bug"
 completed = false
 
+[[items]]
+name = "container"
+description = '''
+write a container build file and push it to containers.openfl.eu/local/yampl
+'''
+type = "task"
+completed = true
+
 [[items]]
 name = "hosted"
 description = '''
-Host yampl for yampl on project.openfl.eu/yamlp
+Host yampl for yampl on project.openfl.eu/yamlp.
 '''
 type = "milestone"
 completed = false
diff --git a/main.go b/main.go
index 311d9982436ff0f12502794a0f2eb8a1561b4994..af621c0ca6ef55e2a5f71839c11b641b4f174b2b 100644 (file)
--- a/main.go
+++ b/main.go
@@ -102,5 +102,5 @@ func main() {
        }
 
        fmt.Println("listening on localhost:8081")
-       panic(http.ListenAndServe(":8081", nil))
+       panic(http.ListenAndServe(":8080", nil))
 }
diff --git a/out.html b/out.html
deleted file mode 100644 (file)
index 1e134bf..0000000
--- a/out.html
+++ /dev/null
@@ -1,43 +0,0 @@
-
-<!DOCTYPE html>
-<html>
-  <head>
-  </head>
-  <body>
-    
-     
-<div>
-  
-  
-  
-  
-  <span style="color: gray"> command line utility </span>
-</div>
-
-    
-     
-<div>
-  
-  
-  <span style="color: black"> http server </span>
-</div>
-
-    
-     
-<div>
-  
-  
-  <span style="color: black"> watch project file </span>
-</div>
-
-    
-     
-<div>
-  
-  
-  <span style="color: black"> heat death of the universe </span>
-</div>
-
-    
-  </body>
-</html>