forked from danger/peril
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
38 lines (29 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
FROM node:14-alpine
WORKDIR /app
# Install system dependencies
# Add deploy user
RUN apk --no-cache --quiet add \
dumb-init && \
adduser -D -g '' deploy && \
mkdir ./api ./dashboard
# Copy files required for installation of application dependencies
COPY package.json yarn.lock ./
COPY api/package.json api/yarn.lock ./api/
COPY dashboard/package.json dashboard/yarn.lock ./dashboard/
# Install application dependencies
RUN yarn global add react-scripts serve && \
yarn install --frozen-lockfile && \
yarn cache clean
COPY . ./
ENV SKIP_PREFLIGHT_CHECK=true
ENV REACT_APP_PUBLIC_API_ROOT_URL="https://peril-api-staging.artsy.net"
ENV REACT_APP_PUBLIC_WEB_ROOT_URL='https://peril-staging.artsy.net'
# Build application
# Update file/directory permissions
RUN yarn workspace dashboard build && \
yarn workspace api build || exit 0 && \
chown -R deploy:deploy ./
# Switch to less-privileged user
USER deploy
ENTRYPOINT ["/usr/bin/dumb-init", "./scripts/load_secrets_and_run.sh"]
CMD ["yarn", "workspace", "api", "start"]