-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathDockerfile
55 lines (50 loc) · 1.38 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
ARG NODE_VERSION=12.10.0
FROM node:${NODE_VERSION}-stretch-slim
# Build time args
ARG CLOUDINARY_CLOUD_NAME
ARG CLOUDINARY_KEY
ARG CLOUDINARY_SECRET
ARG DF_BUILD_REV
ARG DF_DEPLOY_TYPE
ARG GA_TRACKING_ID
ARG GOOGLE_MAPS_KEY
ARG MONGO_URI
ARG TINI_VERSION=v0.18.0
# These should be runtime only, so they should be able to be deleted
ARG COOKIE_SECRET
ARG FACEBOOK_APP_ID
ARG FACEBOOK_APP_SECRET
ARG GOOGLE_CLIENT_ID
ARG GOOGLE_CLIENT_SECRET
ARG REDIS_HOST
ARG REDIS_PASSWORD
ARG REDIS_PORT
ENV DF_BUILD_REV=$DF_BUILD_REV
ENV DF_DEPLOY_TYPE=$DF_DEPLOY_TYPE
ENV PORT 80
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
ENTRYPOINT ["/tini", "--"]
ADD . /app
WORKDIR /app
RUN export \
CLOUDINARY_CLOUD_NAME=$CLOUDINARY_CLOUD_NAME \
CLOUDINARY_KEY=$CLOUDINARY_KEY \
CLOUDINARY_SECRET=$CLOUDINARY_SECRET \
COOKIE_SECRET=$COOKIE_SECRET \
FACEBOOK_APP_ID=$FACEBOOK_APP_ID \
FACEBOOK_APP_SECRET=$FACEBOOK_APP_SECRET \
GA_TRACKING_ID=$GA_TRACKING_ID \
GOOGLE_CLIENT_ID=$GOOGLE_CLIENT_ID \
GOOGLE_CLIENT_SECRET=$GOOGLE_CLIENT_SECRET \
GOOGLE_MAPS_KEY=$GOOGLE_MAPS_KEY \
MONGO_URI=$MONGO_URI \
REDIS_HOST=$REDIS_HOST \
REDIS_PASSWORD=$REDIS_PASSWORD \
REDIS_PORT=$REDIS_PORT \
SENDGRID_API_KEY=$SENDGRID_API_KEY \
&& \
chmod a+x /tini && \
yarn && \
yarn build && \
yarn cache clean
CMD ["yarn", "start"]