Skip to content

Instantly share code, notes, and snippets.

@RoboCOVA
Forked from SHAGGYER/Dockerfile
Created October 2, 2020 16:06
Show Gist options
  • Select an option

  • Save RoboCOVA/c496a31cd0c8485e58353a8dece108c0 to your computer and use it in GitHub Desktop.

Select an option

Save RoboCOVA/c496a31cd0c8485e58353a8dece108c0 to your computer and use it in GitHub Desktop.
Docker - Node JS - React - DigitalOcean Deployment
version: "3"
services:
app:
build: ./
expose:
- 80
restart: always
environment:
VIRTUAL_HOST: YOUR_DOMAIN
VIRTUAL_PORT: 5000
LETSENCRYPT_HOST: YOUR_DOMAIN
LETSENCRYPT_EMAIL: YOUR_EMAIL
networks:
default:
external:
name: nginx-proxy
# Setup and build the client
FROM node:10 as client
WORKDIR /usr/app/client/
COPY client/package*.json ./
RUN yarn install
COPY client/ ./
RUN yarn run build
# Setup the server
FROM node:10
WORKDIR /usr/app/
COPY --from=client /usr/app/client/build/ ./client/build/
WORKDIR /usr/app/server/
COPY server/package*.json ./
RUN yarn
COPY server/ ./
EXPOSE 5000
CMD ["npm", "start"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment