Listory/docker-compose.yml

84 lines
2 KiB
YAML
Raw Normal View History

2020-01-25 22:19:14 +01:00
version: "3.4"
services:
db:
2020-05-07 01:45:49 +02:00
image: postgres:12.2
2020-01-25 22:19:14 +01:00
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:
2020-05-03 03:47:24 +02:00
DB_HOST: db
2020-01-25 22:19:14 +01:00
DB_USERNAME: listory
DB_PASSWORD: listory
2020-05-03 03:47:24 +02:00
DB_DATABASE: listory
2020-05-03 20:57:03 +02:00
JWT_SECRET: listory
2020-05-03 03:47:24 +02:00
APP_URL: "http://localhost:3000"
2020-01-25 22:19:14 +01:00
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
2020-02-01 16:11:48 +01:00
- "traefik.http.routers.api.rule=PathPrefix(`/api`)"
2020-01-26 19:07:15 +01:00
- "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/postcss.config.js:/app/frontend/postcss.config.js:ro
- ./frontend/src:/app/frontend/src:ro
- ./frontend/public:/app/frontend/public:ro
- tailwind-output:/app/frontend/src/tailwind/
# Workaround for https://github.com/facebook/create-react-app/issues/8688
stdin_open: true
2020-01-26 19:07:15 +01:00
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:
2020-02-01 16:11:48 +01:00
#- --log.level=debug
2020-01-26 19:07:15 +01:00
#- --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
volumes:
tailwind-output: {}
2020-01-25 22:19:14 +01:00
networks:
2020-01-26 19:07:15 +01:00
db: {}
web: {}