from origin repo gh:ddworken/hishtory, commit 480630e9181167b51554f4407db55717d9b7e4dd

This commit is contained in:
setop
2022-11-13 10:56:08 +01:00
commit 96d048fba6
99 changed files with 12962 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
# A fork of Dockerfile that doesn't hard code GOARCH and that uses wait-for to wait
# until the postgres server is up. Meant to be used in the docker-compose file for self hosting.
FROM golang:1.18 AS builder
COPY go.mod ./
COPY go.sum ./
RUN unset GOPATH; go mod download
COPY . ./
RUN unset GOPATH; go build -o /server -ldflags "-X main.ReleaseVersion=v0.`cat VERSION`" backend/server/server.go
FROM golang:1.18
RUN apt-get update && apt-get install -y netcat
# Downlaod wait-for from a specific commit hash. This ensures that the owner of wait-for isn't in our TCB (though Github still is)
RUN curl https://raw.githubusercontent.com/eficode/wait-for/59bec22851ba83e9cc735a67a7d961f8aae2cd85/wait-for > /wait-for
RUN chmod +x /wait-for
COPY --from=builder /server /server
CMD ["/wait-for", "postgres:5432", "--", "/server"]