Last active
September 20, 2020 09:06
-
-
Save Viranchee/eb57b2c4c78370059693d7f6fcb22eef to your computer and use it in GitHub Desktop.
Blitz DockerFile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3.8' | |
services: | |
blitz: | |
container_name: blitz | |
build: . | |
ports: | |
- 3000:8080 | |
volumes: | |
- ~/blitz:/home/ | |
# tunnel: | |
# container_name: argotunnel | |
# image: msnelling/cloudflared:latest | |
# # link | |
# volumes: | |
# - ~/.cloudflared/cert.pem:/etc/cloudflared/cert.pem | |
# - ~/docker/cloudflare/config.yml:/etc/cloudflared/config.yml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install all node_modules and build the project | |
FROM node:14.11.0-alpine3.11 as builder | |
USER node | |
RUN mkdir /home/node/code | |
WORKDIR /home/node/code | |
COPY --chown=node:node package.json yarn.lock ./ | |
RUN yarn install --pure-lockfile | |
COPY --chown=node:node . . | |
RUN yarn build | |
# Install node_modules for production | |
FROM node:14.11.0-alpine3.11 as production | |
USER node | |
WORKDIR /home/node/code | |
COPY --chown=node:node package.json yarn.lock ./ | |
RUN yarn install --pure-lockfile --production | |
# Copy the above into a slim container | |
FROM node:14.11.0-alpine3.11 | |
USER node | |
WORKDIR /home/node/code | |
COPY . . | |
COPY --from=production /app/node_modules ./node_modules | |
COPY --from=builder /app/.next ./.next | |
EXPOSE 3000 | |
CMD ["./node_modules/.bin/blitz", "start", "--production"] |
To have cloudflare argo tunnel directly set up:
- use these docs
- uncomment
tunnel
configuration fromdocker-compose.yml
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
DockerFile