obs-portal/docker-compose.yaml

109 lines
2.6 KiB
YAML

# This docker-compose file is intended for development use. You can simply run
# `docker-compose up -d` in the repository and it should build and run all
# required parts of the application. See README.md for details.
#
# For a production docker setup, please check the corresponding documentation.
version: '3'
services:
mongo:
image: mongo
tty: true
volumes:
- ./local/mongo:/data/db
ports:
- '27017:27017'
restart: on-failure
postgres:
image: "openmaptiles/postgis:6.0"
environment:
POSTGRES_USER: obs
POSTGRES_PASSWORD: obs
POSTGRES_DB: obs
ports:
- '5432:5432'
volumes:
- ./local/postgres/data:/var/lib/postgresql/data
api:
image: openbikesensor-api
build:
context: ./api/
dockerfile: Dockerfile
volumes:
- ./api/obs:/opt/obs/api/obs
- ./api/scripts/obs:/opt/obs/scripts/obs
- ./api/tools:/opt/obs/api/tools
- ./api/config.dev.py:/opt/obs/api/config.py
- ./frontend/build:/opt/obs/frontend/build
- ./tile-generator:/opt/obs/tile-generator
- ./local/api-data:/data
- ./tile-generator/data/:/tiles
links:
- postgres
- keycloak
ports:
- '3000:3000'
restart: on-failure
command:
- openbikesensor-api
worker:
image: openbikesensor-api
build:
context: ./api/
dockerfile: Dockerfile
volumes:
- ./api/obs:/opt/obs/api/obs
- ./api/scripts/obs:/opt/obs/scripts/obs
- ./api/tools:/opt/obs/api/tools
- ./api/config.dev.py:/opt/obs/api/config.py
- ./local/api-data:/data
links:
- postgres
- keycloak
restart: on-failure
command:
- python
- tools/process_track.py
frontend:
image: openbikesensor-frontend
build:
context: ./frontend
volumes:
- ./frontend/src:/opt/obs/frontend/src
- ./frontend/public:/opt/obs/frontend/public
- ./frontend/tsconfig.json:/opt/obs/frontend/tsconfig.json
- ./frontend/package.json:/opt/obs/frontend/package.json
- ./frontend/webpack.config.js:/opt/obs/frontend/webpack.config.js
links:
- api
environment:
# used for proxy only
- API_URL=http://api:3000/
ports:
- '3001:3001'
restart: on-failure
command:
- npm
- start
keycloak:
image: jboss/keycloak
ports:
- 3003:8080
links:
- postgres
environment:
KEYCLOAK_USER: admin
KEYCLOAK_PASSWORD: admin
KEYCLOAK_FRONTEND_URL: http://localhost:3003/auth/
DB_VENDOR: postgres
DB_ADDR: postgres
DB_DATABASE: obs
DB_USER: obs
DB_PASSWORD: obs