add data service to docker-compose

This commit is contained in:
Andrey Bakhvalov 2018-10-11 12:50:27 +03:00
parent dbcd4f8679
commit 8c92eafd62

View File

@ -11,25 +11,29 @@ services:
- ./src:/usr/share/nginx/html - ./src:/usr/share/nginx/html
ports: ports:
- 80:80 - 80:80
data:
build:
context: .
dockerfile: data.Dockerfile
depends_on:
- db
volumes:
- ./data:/data
martin: martin:
image: urbica/martin image: urbica/martin
restart: unless-stopped restart: unless-stopped
environment: environment:
- DATABASE_URL=postgres://postgres@db/db - DATABASE_URL=postgres://postgres:postgres@db/db
depends_on: depends_on:
- db - db
db: db:
image: timescale/timescaledb-postgis image: timescale/timescaledb-postgis
restart: unless-stopped restart: unless-stopped
environment: environment:
- POSTGRES_DB=db - POSTGRES_DB=db
- POSTGRES_USER=postgres - POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
volumes: volumes:
- ./data:/data - ./data:/data
- ./db:/var/lib/postgresql/data - ./db:/var/lib/postgresql/data
- ./scripts:/scripts
- ./scripts/initdb.sql:/docker-entrypoint-initdb.d/initdb.sql - ./scripts/initdb.sql:/docker-entrypoint-initdb.d/initdb.sql
ports:
- 5432:5432