Created
March 8, 2019 10:27
-
-
Save notyes/6e9b2241c7dc4cf82e7c6e7c047bc891 to your computer and use it in GitHub Desktop.
File docker compose for run node and nginx
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
| # file config rout server ip to domain | |
| server { | |
| listen 80; | |
| server_name node.workzone.dev; | |
| access_log /var/log/nginx/domain1.access.log; | |
| location / { | |
| proxy_pass http://node.workzone.dev:3000/; | |
| } | |
| } |
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
| # file docker run node | |
| FROM node:7.7.2-alpine | |
| WORKDIR /usr/app | |
| COPY ./app/package.json . | |
| RUN npm install --quiet | |
| COPY . . |
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
| # file run nginx and letsencrypt domain in node | |
| version: '3' | |
| services: | |
| nginx: | |
| image: nginx:1.13.12-alpine | |
| container_name: nginx | |
| volumes: | |
| - ./nginx/:/etc/nginx/conf.d/ | |
| environment: | |
| - VIRTUAL_HOST=node.workzone.dev | |
| - LETSENCRYPT_HOST=node.workzone.dev | |
| - [email protected] | |
| networks: | |
| - webproxy | |
| networks: | |
| webproxy: | |
| external: | |
| name: webproxy |
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" | |
| # file run node and volume root file workder | |
| services: | |
| webnode: | |
| build: . | |
| command: npm run start | |
| container_name: node.workzone.dev | |
| volumes: | |
| - ./app:/usr/app/ | |
| ports: | |
| - "3000:3000" | |
| expose: | |
| - 3000 | |
| networks: | |
| - webproxy | |
| networks: | |
| webproxy: | |
| external: | |
| name: webproxy |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment