mirror of
https://github.com/ddworken/hishtory.git
synced 2025-01-04 21:29:17 +01:00
a3e6d5a940
* use alpine for small docker images * use docker compose to wait for the database to be ready * use a single Dockerfile with parameters to determine the correct GOARCH * update makefile to account for the new GOARCH parameter on the Dockerfile * remove native-arch-Dockerfile
15 lines
404 B
Docker
15 lines
404 B
Docker
FROM golang:1.18-alpine3.17 AS builder
|
|
|
|
WORKDIR /app
|
|
COPY go.mod go.sum ./
|
|
RUN go mod download
|
|
COPY . ./
|
|
ARG GOARCH
|
|
RUN apk add --update --no-cache --virtual .build-deps build-base && \
|
|
GOARCH=${GOARCH} go build -o /server -ldflags "-X main.ReleaseVersion=v0.`cat VERSION`" backend/server/server.go && \
|
|
apk del .build-deps
|
|
|
|
FROM alpine:3.17
|
|
COPY --from=builder /server /server
|
|
CMD ["/server"]
|