Files
arbeitszeitmessung/Backend/Dockerfile
Tom Tröger c10ab98997
Some checks failed
Arbeitszeitmessung Deploy / Build Webserver (push) Failing after 1m14s
Tests / Run Go Tests (push) Successful in 1m48s
fixed problem, where migrate could not connect to db
2026-01-18 22:42:07 +01:00

28 lines
548 B
Docker

# syntax=docker/dockerfile:1
FROM --platform=$BUILDPLATFORM golang:alpine AS build
ARG TARGETOS
ARG TARGETARCH
ENV CGO_ENABLED=0 \
GOOS=$TARGETOS \
GOARCH=$TARGETARCH
WORKDIR /app
COPY go.mod go.sum /app/
RUN go mod download && go mod verify
COPY . .
RUN go build -o server .
FROM alpine:3.22
RUN apk add --no-cache tzdata typst
WORKDIR /app
COPY --from=build /app/server /app/server
COPY ../migrations /app/migrations
COPY ./doc/static /doc/static
COPY ./doc/templates /doc/templates
COPY /static /app/static
ENTRYPOINT ["./server"]