forked from async-labs/saas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
62 lines (41 loc) · 1.21 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
FROM node:10-alpine as install
ARG LOG_LEVEL=error
ENV NPM_CONFIG_LOGLEVEL ${LOG_LEVEL}
ARG NODE_ENV=production
ENV NODE_ENV ${NODE_ENV}
COPY package.json .
COPY yarn.lock .
RUN yarn install --ignore-scripts --frozen-lockfile --ignore-optional
FROM node:10-alpine as build
# repeated ARG's, see Note in https://docs.docker.com/compose/compose-file/#args
ARG LOG_LEVEL=error
ENV NPM_CONFIG_LOGLEVEL ${LOG_LEVEL}
ARG NODE_ENV=production
ENV NODE_ENV ${NODE_ENV}
ARG PORT=3000
ENV PORT ${PORT}
ARG API_PORT=8000
ENV API_PORT ${API_PORT}
ARG URL_API
ENV URL_API ${URL_API}
ARG URL_APP
ENV URL_APP ${URL_APP}
ARG LAMBDA_API_ENDPOINT
ENV LAMBDA_API_ENDPOINT ${LAMBDA_API_ENDPOINT}
ARG STRIPEPUBLISHABLEKEY
ENV STRIPEPUBLISHABLEKEY ${STRIPEPUBLISHABLEKEY}
ARG BUCKET_FOR_POSTS
ENV BUCKET_FOR_POSTS ${BUCKET_FOR_POSTS}
ARG BUCKET_FOR_TEAM_AVATARS
ENV BUCKET_FOR_TEAM_AVATARS ${BUCKET_FOR_TEAM_AVATARS}
ARG GA_TRACKING_ID
ENV GA_TRACKING_ID ${GA_TRACKING_ID}
# next is more eager, and requires most of the source code
# so here we don't have an intermediate stage, we build and are
# ready to run.
WORKDIR /usr/src/app
COPY --from=install node_modules node_modules
COPY . .
RUN yarn build
EXPOSE ${PORT}
CMD ["yarn", "start"]