forked from RueNetwork/RueClient
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
41 lines (33 loc) · 1.02 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
FROM node:10.16.3
LABEL maintainer="Automattic"
WORKDIR /calypso
ENV CONTAINER 'docker'
ENV NODE_PATH=/calypso/server:/calypso/client
# 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