Skip to content

Instantly share code, notes, and snippets.

@Viranchee
Last active September 20, 2020 09:06
Show Gist options
  • Save Viranchee/eb57b2c4c78370059693d7f6fcb22eef to your computer and use it in GitHub Desktop.
Save Viranchee/eb57b2c4c78370059693d7f6fcb22eef to your computer and use it in GitHub Desktop.
Blitz DockerFile
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
# 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"]
@Viranchee
Copy link
Author

DockerFile

@Viranchee
Copy link
Author

To have cloudflare argo tunnel directly set up:

  • use these docs
  • uncomment tunnel configuration from docker-compose.yml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment