-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
40 lines (30 loc) · 1 KB
/
Dockerfile
File metadata and controls
40 lines (30 loc) · 1 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
38
39
FROM mhart/alpine-node:12
ENV NODE_ENV=production
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
ENV DISABLE_SERVERLESS=true
ENV IS_DOCKER=true
WORKDIR /usr/src/app/client
COPY package.json package.json
COPY .next .next
COPY next.config.js next.config.js
COPY env.js env.js
# will throw "error Couldn't find the binary git" without git (since we have a tar/github repo in deps)
# https://stackoverflow.com/questions/50837605/git-install-fails-in-dockerfile
# https://github.com/nodejs/docker-node/issues/586
# https://github.com/gliderlabs/docker-alpine/blob/master/docs/usage.md#virtual-packages
RUN apk add git
# @todo - pure-lockfile --frozen
RUN yarn install \
--production \
--network-timeout 1000000 \
--ignore-optional --skip-integrity-check \
--ignore-scripts \
--ignore-engines && \
yarn cache clean
RUN ls -la . && cd .next && ls -la . && echo "hash2"
RUN apk del git
EXPOSE 3000
EXPOSE 80
CMD ["npx", "next", "start"]
# CMD ["yarn", "start"]
# CMD ["pm2-runtime", "dist/ecosystem.docker.config.js"]