hour-tracker/Dockerfile
2025-08-03 11:32:05 +03:00

43 lines
838 B
Docker

# -----------------------
# 1. Frontend build stage
# -----------------------
FROM oven/bun:latest AS frontend-builder
COPY /front-end /repo/front-end
WORKDIR /repo/front-end
RUN bun install && bun run build
# -----------------------
# 2. Backend build stage
# -----------------------
FROM golang:1.24.5-alpine AS backend-builder
COPY /back-end /repo/back-end
WORKDIR /repo/back-end
RUN go build -o server .
# -----------------------
# 3. Final stage
# -----------------------
FROM alpine:latest
# Set up working directory
WORKDIR /app
# Copy Go binary
COPY --from=backend-builder /repo/back-end/server /app/server
# Copy frontend assets
COPY --from=frontend-builder /repo/front-end/dist /app/pb_public
# Set entrypoint
ENTRYPOINT [
"./server",
"--dir",
"/pb_data",
"serve",
"--http",
"127.0.0.1:8090"
]