forked from artsy/force
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
40 lines (31 loc) · 921 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
FROM node:12.14-alpine
# Install system dependencies
# Add deploy user
RUN apk --no-cache --quiet add \
bash \
build-base \
curl \
dumb-init \
git \
python && \
adduser -D -g '' deploy
WORKDIR /app
# Set the correct owner on the /app
RUN chown deploy:deploy $(pwd)
# Switch to less-privileged user, do this early to ensure files are created
# with proper ownership.
USER deploy
# Copy files required for installation of application dependencies
COPY --chown=deploy:deploy package.json yarn.lock ./
COPY --chown=deploy:deploy patches ./patches
# Install application dependencies
RUN yarn install --frozen-lockfile --quiet && \
yarn cache clean --force
# Copy application code
COPY --chown=deploy:deploy . ./
# Build application
# Update file/directory permissions
RUN yarn assets && \
yarn build:server
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
CMD ["yarn", "start"]