docker-compose.yml 881 Bytes
version: "3"
services:

 web:
  image: nginx
  container_name: nginx
  ports:
   - "8081:80"
  networks:
   mynet:
    ipv4_address: 172.28.0.2
  volumes:
   - ./nginx/nginx.conf:/etc/nginx/conf.d/default.conf
   - ./web:/var/www/html
  restart: on-failure
  links:
   - app
 
 svelte:
  image: node
  container_name: svelte
  working_dir: /var/www/html
  volumes:
   - ./web:/var/www/html
  command: bash -c "npm install && npm run dev"
  restart: on-failure

 app:
  image: node
  container_name: node
  ports:
   - "8082:80"
  networks:
   mynet:
    ipv4_address: 172.28.0.3
  working_dir: /app
  volumes:
   - ./node:/app
   - ./config:/app/config
  command: bash -c "npm install && node_modules/.bin/nodemon app.js"
  environment:
   - NODE_ENV=production
  restart: on-failure

networks:
  mynet:
    ipam:
      driver: default
      config:
        - subnet: 172.28.0.0/16