diff options
Diffstat (limited to 'backend')
| -rw-r--r-- | backend/Dockerfile | 13 | ||||
| -rw-r--r-- | backend/Dockerfile.tools | 13 | ||||
| -rw-r--r-- | backend/main.go | 6 |
3 files changed, 26 insertions, 6 deletions
diff --git a/backend/Dockerfile b/backend/Dockerfile new file mode 100644 index 0000000..1d1523d --- /dev/null +++ b/backend/Dockerfile @@ -0,0 +1,13 @@ +FROM golang:1.22.3 AS builder + +WORKDIR /build +COPY . /build +RUN go build -o /build/server . + +################################################################################ +FROM golang:1.22.3 + +WORKDIR /app +COPY --from=builder /build/server /app/server + +CMD ["/app/server"] diff --git a/backend/Dockerfile.tools b/backend/Dockerfile.tools new file mode 100644 index 0000000..de025b8 --- /dev/null +++ b/backend/Dockerfile.tools @@ -0,0 +1,13 @@ +FROM golang:1.22.3 + +WORKDIR /tools + +RUN wget -O psqldef.tar.gz https://github.com/sqldef/sqldef/releases/download/v0.17.14/psqldef_linux_amd64.tar.gz + +RUN tar -xzf psqldef.tar.gz && \ + rm -f psqldef.tar.gz + +RUN touch /usr/local/bin/psqldef && \ + echo '#!/bin/sh' >> /usr/local/bin/psqldef && \ + echo '/tools/psqldef --user="$POSTGRES_USER" --password="$POSTGRES_PASSWORD" --host=db "$POSTGRES_DB" "$@"' >> /usr/local/bin/psqldef && \ + chmod +x /usr/local/bin/psqldef diff --git a/backend/main.go b/backend/main.go index 257647c..26859e5 100644 --- a/backend/main.go +++ b/backend/main.go @@ -165,12 +165,6 @@ func main() { e := echo.New() - e.Static("/assets", "public/assets") - - e.GET("/*", func(c echo.Context) error { - return c.File("public/index.html") - }) - e.GET("/sock/golf/:gameId/watch", func(c echo.Context) error { gameId := c.Param("gameId") gameIdInt, err := strconv.Atoi(gameId) |
