From: Fl_GUI Date: Sun, 26 Jan 2025 12:06:21 +0000 (+0100) Subject: add container file and task. X-Git-Url: https://git.openfl.eu/?a=commitdiff_plain;h=7768fcf8198df99a5cb743a87f9fd697cea8c8a6;p=yampl.git add container file and task. --- diff --git a/Containerfile b/Containerfile new file mode 100644 index 0000000..09bd2b5 --- /dev/null +++ b/Containerfile @@ -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 index 0000000..2b584ec --- /dev/null +++ b/compose.yaml @@ -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: diff --git a/examples/toml/yampl.toml b/examples/toml/yampl.toml index 25cce17..36ea1ef 100644 --- a/examples/toml/yampl.toml +++ b/examples/toml/yampl.toml @@ -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 311d998..af621c0 100644 --- 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 index 1e134bf..0000000 --- a/out.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - -
- - - - - command line utility -
- - - -
- - - http server -
- - - -
- - - watch project file -
- - - -
- - - heat death of the universe -
- - - -