Skip to content

Commit b55d66b

Browse files
committed
feat: add Dockerfile for server-side build and deployment
1 parent 0c22148 commit b55d66b

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

docker/Dockerfile.serversideup

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
FROM golang:1.23-alpine AS builder
2+
3+
WORKDIR /build
4+
COPY . .
5+
6+
RUN apk add --no-cache gcc musl-dev
7+
RUN go mod download
8+
RUN CGO_ENABLED=1 GOOS=linux go build -o /build/app .
9+
10+
FROM alpine:latest
11+
12+
WORKDIR /app
13+
RUN apk --no-cache add ca-certificates postgresql-client
14+
15+
COPY --from=builder /build/app ./app
16+
COPY migrations/ ./migrations/
17+
RUN chmod +x ./app
18+
RUN mkdir -p assets
19+
20+
EXPOSE 8080
21+
CMD ["./app"]

0 commit comments

Comments
 (0)