Advertisement
ArturManukian

docker-compose with env variables

Aug 7th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 0.60 KB | None | 0 0
  1. version: '3'
  2.  
  3. services:
  4.   app:
  5.     build: ./src
  6.     container_name: sskey_app
  7.     links:
  8.     - db
  9.     environment:
  10.     - POSTGRES_USER=postgres
  11.       - POSTGRES_PASS=postgres
  12.       - POSTGRES_HOST=db  # database service name
  13.       - POSTGRES_NAME=db_sskey
  14.     ports:
  15.     - "5000:5000"
  16.     depends_on:
  17.     - db
  18.  
  19.   db:
  20.     image: postgres:10.4
  21.     container_name: sskey_db
  22.     restart: always
  23.     environment:
  24.     - POSTGRES_USER=postgres
  25.       - POSTGRES_PASS=postgres
  26.       - POSTGRES_HOST=db  # database service name
  27.       - POSTGRES_NAME=db_sskey
  28.     ports:
  29.     - "5432:5432"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement