Listory/docker-compose.yml

74 lines
1.7 KiB
YAML
Raw Normal View History

2020-01-25 22:19:14 +01:00
version: "3.4"
services:
db:
image: postgres:12.1
environment:
POSTGRES_PASSWORD: listory
POSTGRES_USER: listory
POSTGRES_DB: listory
networks:
2020-01-26 19:07:15 +01:00
- db
2020-01-25 22:19:14 +01:00
2020-01-26 19:07:15 +01:00
api:
2020-01-25 22:19:14 +01:00
build:
context: .
2020-01-26 19:07:15 +01:00
target: build-api
2020-01-25 22:19:14 +01:00
command: ["npm", "run", "start:dev"]
environment:
DB_USERNAME: listory
DB_PASSWORD: listory
DB_HOST: db
env_file: .env
volumes:
- ./src:/app/src
ports:
2020-01-26 19:07:15 +01:00
- 3000
labels:
- "traefik.enable=true" # Enable reverse-proxy for this service
- "traefik.http.routers.api.rule=PathPrefix(`/api/v1`)"
- "traefik.http.routers.api.entrypoints=web"
2020-01-25 22:19:14 +01:00
networks:
2020-01-26 19:07:15 +01:00
- web
- db
frontend:
build:
context: .
target: build-frontend
command: ["npm", "run", "start"]
volumes:
- ./frontend/src:/app/frontend/src
- ./frontend/public:/app/frontend/public
ports:
- 3000
labels:
- "traefik.enable=true" # Enable reverse-proxy for this service
- "traefik.http.routers.frontend.rule=PathPrefix(`/`)"
- "traefik.http.routers.frontend.entrypoints=web"
networks:
- web
proxy:
image: traefik
command:
- --log.level=debug
#- --accesslog=true
- --api # Enables the web UI
- --api.insecure=true
- --providers.docker=true
- --providers.docker.exposedbydefault=false
- --providers.docker.network=listory_web
- --entrypoints.web.address=:3000
ports:
- "3000:3000" # The HTTP port
- "8080:8080" # The web UI
networks:
- web
volumes:
- /var/run/docker.sock:/var/run/docker.sock # So that Traefik can listen to the Docker events
2020-01-25 22:19:14 +01:00
networks:
2020-01-26 19:07:15 +01:00
db: {}
web: {}