Initial Dockerfile
This commit is contained in:
parent
179f886610
commit
d868e9203d
2 changed files with 46 additions and 0 deletions
3
.dockerignore
Normal file
3
.dockerignore
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
node_modules
|
||||||
|
dist
|
||||||
|
pb_data
|
||||||
43
Dockerfile
Normal file
43
Dockerfile
Normal 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"
|
||||||
|
]
|
||||||
Loading…
Add table
Reference in a new issue