-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
43 lines (32 loc) · 1011 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
39
40
41
42
43
# Build stage
FROM node:16 AS builder
ENV HOST=http://localhost:4000
ENV BURDY_HOST=http://localhost:4000
ENV PREVIEW_BASE_URL=http://localhost:4000
ENV NEXT_PUBLIC_CMS_URL=http://localhost:4000
ENV NEXT_PUBLIC_HOST=https://localhost:4000
ENV ASSETS_CACHE_CONTROL="max-age=2592000"
ENV PUBLIC_ENABLE_PREVIEW_EDITOR=true
WORKDIR /build
COPY . .
RUN npm ci
RUN npm run db:make-migration
RUN npm run db:init
RUN npm run db:import
RUN npm run build
# Worker stage
FROM node:16 AS worker
ENV HOST=http://localhost:4000
ENV BURDY_HOST=http://localhost:4000
ENV PREVIEW_BASE_URL=http://localhost:4000
ENV NEXT_PUBLIC_CMS_URL=http://localhost:4000
ENV NEXT_PUBLIC_HOST=https://localhost:4000
ENV ASSETS_CACHE_CONTROL="max-age=2592000"
ENV PUBLIC_ENABLE_PREVIEW_EDITOR=true
WORKDIR /app
COPY --from=builder /build/node_modules ./node_modules
COPY --from=builder /build/.next ./.next
COPY --from=builder /build/burdy ./burdy
COPY --from=builder /build/package.json ./package.json
EXPOSE 4000
CMD npm run start