Skip to content

Instantly share code, notes, and snippets.

@notyes
Created March 8, 2019 10:27
Show Gist options
  • Save notyes/6e9b2241c7dc4cf82e7c6e7c047bc891 to your computer and use it in GitHub Desktop.
Save notyes/6e9b2241c7dc4cf82e7c6e7c047bc891 to your computer and use it in GitHub Desktop.
File docker compose for run node and nginx
# 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/;
}
}
# file docker run node
FROM node:7.7.2-alpine
WORKDIR /usr/app
COPY ./app/package.json .
RUN npm install --quiet
COPY . .
# 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
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