This commit is contained in:
23
Dockerfile
Normal file
23
Dockerfile
Normal file
@@ -0,0 +1,23 @@
|
||||
FROM golang:1.22-alpine AS backend-builder
|
||||
WORKDIR /app
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
COPY . .
|
||||
RUN go build -o bin/server ./cmd/server
|
||||
|
||||
FROM node:20-alpine AS frontend-builder
|
||||
WORKDIR /app
|
||||
COPY frontend/package.json frontend/package-lock.json ./
|
||||
RUN npm ci
|
||||
COPY frontend/ ./
|
||||
RUN npm run build
|
||||
|
||||
FROM alpine:3.19 AS runner
|
||||
RUN apk add --no-cache ca-certificates postgresql-client
|
||||
WORKDIR /app
|
||||
COPY --from=backend-builder /app/bin/server ./
|
||||
COPY --from=frontend-builder /app/dist ./frontend/dist
|
||||
COPY db/migrations ./db/migrations
|
||||
COPY scripts ./scripts
|
||||
EXPOSE 8080
|
||||
CMD ["./server"]
|
||||
Reference in New Issue
Block a user