-
Notifications
You must be signed in to change notification settings - Fork 16
/
Dockerfile
42 lines (29 loc) · 830 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
# 1/3 Create dependencies image
FROM node:10-alpine AS build-deps
RUN mkdir -p /opt/geo.data.gouv.fr
WORKDIR /opt/geo.data.gouv.fr
COPY package.json yarn.lock ./
RUN yarn --frozen-lockfile --production
# 2/3 Create build image
FROM node:10 AS build-front
RUN mkdir -p /opt/geo.data.gouv.fr
WORKDIR /opt/geo.data.gouv.fr
COPY package.json yarn.lock ./
RUN yarn --frozen-lockfile
COPY . .
ENV NODE_ENV=production
RUN yarn build
# 3/3 Create production image
FROM node:10-alpine
RUN mkdir -p /opt/geo.data.gouv.fr
WORKDIR /opt/geo.data.gouv.fr
COPY server server
COPY locales locales
COPY public public
COPY static static
COPY robots.txt next.config.js ./
COPY --from=build-deps /opt/geo.data.gouv.fr .
COPY --from=build-front /opt/geo.data.gouv.fr/.next .next
ENV NODE_ENV=production
EXPOSE 3000
CMD ["node", "server"]