forked from Automattic/wp-calypso
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
43 lines (34 loc) · 1.03 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
FROM node:12.14.0
LABEL maintainer="Automattic"
WORKDIR /calypso
ENV CONTAINER 'docker'
ENV NODE_PATH=/calypso/server:/calypso/client
ENV PROGRESS=true
# Build a "base" layer
#
# This layer should never change unless env-config.sh
# changes. For local development this should always
# be an empty file and therefore this layer should
# cache well.
#
# env-config.sh
# used by systems to overwrite some defaults
# such as the apt and npm mirrors
COPY ./env-config.sh /tmp/env-config.sh
RUN bash /tmp/env-config.sh
# Build a "source" layer
#
# This layer is populated with up-to-date files from
# Calypso development.
COPY . /calypso/
RUN npm ci
# Build the final layer
#
# This contains built environments of Calypso. It will
# change any time any of the Calypso source-code changes.
ARG commit_sha="(unknown)"
ENV COMMIT_SHA $commit_sha
ARG workers
RUN WORKERS=$workers CALYPSO_ENV=production npm run build
USER nobody
CMD NODE_ENV=production node build/bundle.js