-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
38 lines (27 loc) · 881 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# Build Node frontend
FROM node:23.0.0-alpine AS builder-node
WORKDIR /app
COPY . .
RUN npm i pnpm@9 -g && pnpm i
RUN pnpm i --frozen-lockfile --prod=false
RUN node --run build:client
# Build golang backend
FROM golang:1.23-alpine AS builder-golang
WORKDIR /app
COPY . .
COPY --from=builder-node /app/dist ./dist
RUN go mod download
RUN go build -tags production -o pocket-react
# Final stage
FROM alpine:latest
WORKDIR /app
# Copy the built executable from builder stage
COPY --from=builder-golang /app/pocket-react /pb/pocket-react
# uncomment to copy the local pb_migrations dir into the image
# COPY ./pb_migrations /pb/pb_migrations
# uncomment to copy the local pb_hooks dir into the image
# COPY ./pb_hooks /pb/pb_hooks
EXPOSE 8090
RUN /pb/pocket-react migrate history-sync
RUN /pb/pocket-react migrate up
CMD ["/pb/pocket-react", "serve", "--http=0.0.0.0:8090"]