-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
35 lines (26 loc) · 1.14 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
FROM node:current AS builder
ARG ENVIRONMENT="dev"
# copy whole repo into docker image to start
COPY . .
RUN cp src/config/index.example.js src/config/index.js
# Build stuff, mostly copied from .github/workflows/publish-stage.yaml
#######################################################################
RUN yarn; yarn lint; yarn build:${ENVIRONMENT}
FROM node:current-slim
# copy only build files from builder stage
COPY --chown=node:node --from=builder build /home/node/app/public
COPY --chown=node:node --from=builder node_modules/ /home/node/app/node_modules
COPY --chown=node:node --from=builder /package.json /home/node/app/
COPY --chown=node:node --from=builder src /home/node/app/src
COPY --chown=node:node --from=builder .eslintrc /home/node/app/
COPY --chown=node:node --from=builder .eslintignore /home/node/app/
COPY --chown=node:node docker-scripts/entrypoint.sh /home/node/app/entrypoint.sh
USER node
WORKDIR /home/node/app
ENV STRIPE_PUBLIC_KEY="na"
ENV GOOGLE_ANALYTICS_CODE="na"
ENV YOUTUBE_API_KEY="na"
ENV ENVIRONMENT=$ENVIRONMENT
ENV URL="https://$ENVIRONMENT.studio.harperdb.io"
EXPOSE 3000
ENTRYPOINT ["/home/node/app/entrypoint.sh"]