-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
58 lines (35 loc) · 1.21 KB
/
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# --------------> Build nuxt app
FROM node:23.4.0-bookworm AS ui-build
WORKDIR /nuxt
COPY package.json .yarnrc.yml nuxt.config.ts ./
RUN corepack enable && yarn set version berry && yarn install
COPY app ./app
COPY server ./server
COPY public ./public
RUN yarn build
# --------------> Build pocketbase
FROM golang:1.23.4-bookworm AS pb-build
ENV CGO_ENABLED=0
WORKDIR /pocketbase
COPY ./pocketbase/main.go ./pocketbase/go.mod ./pocketbase/go.sum /pocketbase/
RUN go mod download
RUN go build
COPY ./pocketbase/pb_hooks ./pb_hooks
COPY ./pocketbase/pb_migrations ./pb_migrations
# --------------> The final stage
FROM node:23.4.0-bookworm-slim
# Install Nginx
RUN apt-get update && apt-get install -y nginx ca-certificates
WORKDIR /app
# Copy the build output and other necessary files from the ui build stage
COPY --from=pb-build /pocketbase /pb
COPY --from=ui-build /nuxt/.output /app/ui
COPY .docker/docker-entrypoint.sh /app/entrypoint.sh
COPY .docker/nginx.conf /etc/nginx/nginx.conf
# Make the entrypoint script executable
RUN chmod +x /app/entrypoint.sh
# Install concurrently for running multiple commands
RUN npm install -g concurrently
# Set the entrypoint
ENTRYPOINT ["/app/entrypoint.sh"]
EXPOSE 80 8080 3000