Initial Dockerfile

This commit is contained in:
Niko Reunanen 2025-08-03 11:32:05 +03:00
parent 179f886610
commit d868e9203d
Signed by: nreunane
GPG key ID: D192625387DB0F16
2 changed files with 46 additions and 0 deletions

3
.dockerignore Normal file
View file

@ -0,0 +1,3 @@
node_modules
dist
pb_data

43
Dockerfile Normal file
View file

@ -0,0 +1,43 @@
# -----------------------
# 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"
]