Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

docker-compose microservices

version: '3'
services:
  #######################################
  # APPLICATION USERS SERVICE ENVIRONMENT
  #######################################
  users:
    build:
      context: .
      dockerfile: Dockerfile.users
    restart: always
    ports:
      - 3000:3000
    env_file: ./services/users/.env
    depends_on:
      - database
    volumes:
      - /usr/share/app/services/users
      - /usr/share/app/services/users/node_modules
    networks:
      - node-service
  #######################################
  # APPLICATION ROLES SERVICE ENVIRONMENT
  #######################################
  roles:
    build:
      context: .
      dockerfile: Dockerfile.roles
    restart: always
    ports:
      - 3001:3001
    env_file: ./services/roles/.env
    depends_on:
      - database
    volumes:
      - /usr/share/app/services/roles
      - /usr/share/app/services/roles/node_modules
    networks:
      - node-service
  ##############################
  # DATABASE SERVICE ENVIRONMENT
  ##############################
  database:
    image: mongo:latest
    restart: always
    ports:
      - 27017:27017
    volumes:
      - database:/var/lib/mongodb/data
    networks:
      - node-service
  #############################
  # PROXY SERVICES ENVIRONMENT
  #############################
  proxy:
    build:
      context: .
      dockerfile: Dockerfile.nginx
    restart: always
    ports:
      - 80:80
      - 443:443
    depends_on:
      - users
      - roles
    volumes:
      - ${PWD}/nginx.conf:/etc/nginx/nginx.conf
    networks:
      - node-service
# #############################
# # VOLUME PERSISTENT DATA
# #############################
volumes:
  database:
#############################
# NETWORKS SHARING GROUP
#############################
networks:
  node-service:
Comment

PREVIOUS NEXT
Code Example
Shell :: Bash script to authenticate machine users 
Shell :: webgpu chrome linux 
Shell :: graphic driver in ubuntu 
Shell :: how to take screenshot of the login screen on linux 
Shell :: cargo generate 
Shell :: pip3 or pip? 
Shell :: how to git init 
Shell :: install xampp in ubuntu 20.04 
Shell :: sudo apt-get remove 
Shell :: bash boolean 
Shell :: git commit to previous commit 
Shell :: git fetch only pull master 
Shell :: ubuntu pip cv_bridge 
Shell :: install installatron cpanel 
Shell :: How to Install and Configure doctl on MacOS 
Shell :: bash add multui options to script 
Shell :: open Edge with terminal 
Shell :: iperf test example 
Shell :: Hands-on GitHub Actions: Implement CI/CD with GitHub Action Workflows for Your Applications.pdf 
Shell :: ibus ubuntu 22.04 
Shell :: what is the difference between npm uninstall and remove 
Shell :: gnome tool for open pdf file from terminal 
Shell :: i2c-tools, i2c 
Shell :: install chromedriver in jenkins container 
Shell :: eslint script in package.json 
Shell :: bash script to checker credentials 
Shell :: vim mass replace pattern across multiple files 
Shell :: adb shell command to rotate screen 
Shell :: Restore postgres script file 
Shell :: install arch.univariate import arch_model 
ADD CONTENT
Topic
Content
Source link
Name
2+6 =