172 lines
4.6 KiB
YAML
172 lines
4.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
|
|
|
|
redis:
|
|
image: redis
|
|
volumes:
|
|
- ./local/redis:/data
|
|
command: redis-server --appendonly yes
|
|
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: obs-api
|
|
build:
|
|
context: ./api
|
|
volumes:
|
|
- ./api/src:/opt/obs/api/src
|
|
- ./api/tools:/opt/obs/api/tools
|
|
- ./api/scripts/obs:/opt/obs/api/scripts/obs
|
|
- ./api/views:/opt/obs/api/views
|
|
- ./local/api-data:/data
|
|
- ./api/.migrations.js:/opt/obs/api/.migrations.js
|
|
- ./api/migrations:/opt/obs/api/migrations/
|
|
- ./api/config.dev.json:/opt/obs/api/config.json
|
|
environment:
|
|
- PORT=3000
|
|
- MONGODB_URL=mongodb://mongo/obsTest
|
|
- DATA_DIR=/data
|
|
- POSTGRES_URL="postgresql+asyncpg://obs:obs@localhost/obs"
|
|
links:
|
|
- mongo
|
|
- redis
|
|
ports:
|
|
- '3000:3000'
|
|
restart: on-failure
|
|
command:
|
|
- npm
|
|
- run
|
|
- dev
|
|
|
|
worker:
|
|
image: obs-api
|
|
build:
|
|
context: ./api
|
|
volumes:
|
|
- ./api/src:/opt/obs/api/src
|
|
- ./api/tools:/opt/obs/api/tools
|
|
- ./api/scripts/obs:/opt/obs/api/scripts/obs
|
|
- ./api/views:/opt/obs/api/views
|
|
- ./local/api-data:/data
|
|
- ./api/config.dev.json:/opt/obs/api/config.json
|
|
environment:
|
|
- DATA_DIR=/data
|
|
links:
|
|
- mongo
|
|
- redis
|
|
restart: on-failure
|
|
command: 'bash -c "pip install geopy && npm run dev:worker"'
|
|
|
|
|
|
frontend:
|
|
image: obs-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
|
|
|
|
# Overwrite the default config with the development mode configuration
|
|
- ./frontend/config.dev.json:/opt/obs/frontend/public/config.json
|
|
environment:
|
|
- PORT=3000
|
|
links:
|
|
- api
|
|
ports:
|
|
- '3001:3000'
|
|
restart: on-failure
|
|
command:
|
|
- npm
|
|
- start
|
|
|
|
openmaptiles-tools:
|
|
image: "openmaptiles/openmaptiles-tools:${TOOLS_VERSION}"
|
|
env_file: tile-generator/.env
|
|
environment:
|
|
# Must match the version of this file (first line)
|
|
# download-osm will use it when generating a composer file
|
|
MAKE_DC_VERSION: "3"
|
|
# Allow DIFF_MODE, MIN_ZOOM, and MAX_ZOOM to be overwritten from shell
|
|
DIFF_MODE: ${DIFF_MODE}
|
|
MIN_ZOOM: ${MIN_ZOOM}
|
|
MAX_ZOOM: ${MAX_ZOOM}
|
|
#Provide BBOX from *.bbox file if exists, else from .env
|
|
BBOX: ${BBOX}
|
|
# Imposm configuration file describes how to load updates when enabled
|
|
IMPOSM_CONFIG_FILE: ${IMPOSM_CONFIG_FILE}
|
|
# Control import-sql processes
|
|
MAX_PARALLEL_PSQL: ${MAX_PARALLEL_PSQL}
|
|
|
|
PGDATABASE: obs
|
|
PGUSER: obs
|
|
PGPASSWORD: obs
|
|
PGHOST: postgres
|
|
PGPORT: 5432
|
|
volumes:
|
|
- ./tile-generator/:/tileset
|
|
- ./tile-generator/data:/import
|
|
- ./tile-generator/data:/export
|
|
- ./tile-generator/build/sql:/sql
|
|
- ./tile-generator/build:/mapping
|
|
- ./tile-generator/cache:/cache
|
|
|
|
generate-vectortiles:
|
|
image: "openmaptiles/generate-vectortiles:${TOOLS_VERSION}"
|
|
volumes:
|
|
- ./tile-generator/data:/export
|
|
- ./tile-generator/build/openmaptiles.tm2source:/tm2source
|
|
env_file: tile-generator/.env
|
|
environment:
|
|
FILTER_MAPNIK_OUTPUT: ${FILTER_MAPNIK_OUTPUT}
|
|
MBTILES_NAME: ${MBTILES_FILE}
|
|
BBOX: ${BBOX}
|
|
MIN_ZOOM: ${MIN_ZOOM}
|
|
MAX_ZOOM: ${MAX_ZOOM}
|
|
# Control tilelive-copy threads
|
|
COPY_CONCURRENCY: ${COPY_CONCURRENCY}
|
|
#
|
|
PGDATABASE: obs
|
|
PGUSER: obs
|
|
PGPASSWORD: obs
|
|
PGHOST: postgres
|
|
PGPORT: 5432
|
|
|
|
tileserver:
|
|
image: klokantech/tileserver-gl
|
|
ports:
|
|
- 3002:80
|
|
volumes:
|
|
- ./tile-generator/tileserver-gl-config.json:/config/tileserver.json
|
|
- ./tile-generator/data/:/data
|
|
command:
|
|
- --config
|
|
- /config/tileserver.json
|
|
# - /data/tiles.mbtiles
|