-
-
Save RoboCOVA/c496a31cd0c8485e58353a8dece108c0 to your computer and use it in GitHub Desktop.
Docker - Node JS - React - DigitalOcean Deployment
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" | |
| 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 |
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
| # 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