forked from LearningLocker/learninglocker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (30 loc) · 1.13 KB
/
Dockerfile
File metadata and controls
37 lines (30 loc) · 1.13 KB
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
# syntax=docker/dockerfile:1.8
FROM node:10-stretch AS build
WORKDIR /opt/learninglocker
ADD package.json .yarnrc yarn.lock ./
RUN --mount=type=cache,target=/usr/local/share/.cache/yarn,rw,sharing=locked <<EOF
yarn upgrade @google-cloud/pubsub@0.32.1 --ignore-engines
yarn install --ignore-engines --ignore-platform
EOF
ADD . .
RUN --mount=type=cache,target=/usr/local/share/.cache/yarn,rw,sharing=locked <<EOF
touch .env
yarn build-all
EOF
FROM node:10-stretch-slim AS runtime
WORKDIR /opt/learninglocker
ENV NODE_ENV=production
RUN touch .env
ADD package.json .yarnrc yarn.lock ./
RUN --mount=type=cache,target=/usr/local/share/.cache/yarn,rw,sharing=locked <<EOF
yarn upgrade @google-cloud/pubsub@0.32.1 --ignore-engines
yarn install --ignore-engines --ignore-platform --only=production
EOF
FROM runtime
COPY --from=build /opt/learninglocker/api/dist ./api/dist
COPY --from=build /opt/learninglocker/cli/dist ./cli/dist
COPY --from=build /opt/learninglocker/ui/dist ./ui/dist
COPY --from=build /opt/learninglocker/worker/dist ./worker/dist
COPY lib/templates/emails ./lib/templates/emails
COPY bin ./bin
ENTRYPOINT [ "bin/entrypoint" ]