-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathDockerfile
33 lines (29 loc) · 891 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
## Build pocketbase app
FROM golang:1.19.1 AS BUILDER
ARG ARCH="amd64"
## Build WASM file
RUN wget https://github.com/tinygo-org/tinygo/releases/download/v0.25.0/tinygo_0.25.0_${ARCH}.deb
RUN dpkg -i tinygo_0.25.0_${ARCH}.deb
RUN apt-get install -y make
WORKDIR /app/pb_public
WORKDIR /app/
COPY ./ ./
RUN make build
## Build front end
RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash -
RUN apt-get install -y nodejs
RUN npm install -g yarn
RUN yarn
RUN yarn build
# Build server
RUN CGO_ENABLED=0 go build -o pocketbase ./cmd/main.go
## Build the production image
FROM alpine:3.6
WORKDIR /app/
RUN apk add --no-cache ca-certificates
COPY --from=BUILDER /app/migrations ./migrations
COPY --from=BUILDER /app/pocketbase .
COPY --from=BUILDER /app/.env .
COPY --from=BUILDER /app/pb_public ./pb_public
EXPOSE 8090
ENTRYPOINT [ "/app/pocketbase", "serve", "--http=0.0.0.0:8090"]