version: '3.4' services: api-dev: container_name: trmm-api-dev image: api-dev restart: always user: 1000:1000 build: context: .. dockerfile: .devcontainer/api.dockerfile command: [ "tactical-api" ] environment: API_PORT: ${API_PORT} ports: - "8000:${API_PORT}" volumes: - tactical-data-dev:/opt/tactical - ..:/workspace:cached networks: dev: aliases: - tactical-backend app-dev: container_name: trmm-app-dev image: node:16-alpine restart: always command: /bin/sh -c "npm install npm@latest -g && npm install && npm run serve -- --host 0.0.0.0 --port ${APP_PORT}" working_dir: /workspace/web volumes: - ..:/workspace:cached ports: - "8080:${APP_PORT}" networks: dev: aliases: - tactical-frontend # nats nats-dev: container_name: trmm-nats-dev image: ${IMAGE_REPO}tactical-nats:${VERSION} restart: always user: 1000:1000 environment: API_HOST: ${API_HOST} API_PORT: ${API_PORT} DEV: 1 ports: - "${NATS_PORTS}" volumes: - tactical-data-dev:/opt/tactical - ..:/workspace:cached networks: dev: aliases: - ${API_HOST} - tactical-nats # meshcentral container meshcentral-dev: container_name: trmm-meshcentral-dev image: ${IMAGE_REPO}tactical-meshcentral:${VERSION} restart: always user: 1000:1000 environment: MESH_HOST: ${MESH_HOST} MESH_USER: ${MESH_USER} MESH_PASS: ${MESH_PASS} MONGODB_USER: ${MONGODB_USER} MONGODB_PASSWORD: ${MONGODB_PASSWORD} NGINX_HOST_IP: ${DOCKER_NGINX_IP} networks: dev: aliases: - tactical-meshcentral - ${MESH_HOST} volumes: - tactical-data-dev:/opt/tactical - mesh-data-dev:/home/node/app/meshcentral-data depends_on: - mongodb-dev # mongodb container for meshcentral mongodb-dev: container_name: trmm-mongodb-dev image: mongo:4.4 restart: always user: 1000:1000 environment: MONGO_INITDB_ROOT_USERNAME: ${MONGODB_USER} MONGO_INITDB_ROOT_PASSWORD: ${MONGODB_PASSWORD} MONGO_INITDB_DATABASE: meshcentral networks: dev: aliases: - tactical-mongodb volumes: - mongo-dev-data:/data/db # postgres database for api service postgres-dev: container_name: trmm-postgres-dev image: postgres:13-alpine restart: always environment: POSTGRES_DB: ${POSTGRES_DB} POSTGRES_USER: ${POSTGRES_USER} POSTGRES_PASSWORD: ${POSTGRES_PASS} volumes: - postgres-data-dev:/var/lib/postgresql/data networks: dev: aliases: - tactical-postgres # redis container for celery tasks redis-dev: container_name: trmm-redis-dev restart: always user: 1000:1000 command: redis-server image: redis:6.0-alpine volumes: - redis-data-dev:/data networks: dev: aliases: - tactical-redis init-dev: container_name: trmm-init-dev image: api-dev restart: on-failure command: [ "tactical-init-dev" ] environment: POSTGRES_USER: ${POSTGRES_USER} POSTGRES_PASS: ${POSTGRES_PASS} APP_HOST: ${APP_HOST} API_HOST: ${API_HOST} MESH_HOST: ${MESH_HOST} MESH_USER: ${MESH_USER} TRMM_USER: ${TRMM_USER} TRMM_PASS: ${TRMM_PASS} HTTP_PROTOCOL: ${HTTP_PROTOCOL} APP_PORT: ${APP_PORT} POSTGRES_DB: ${POSTGRES_DB} depends_on: - postgres-dev - meshcentral-dev networks: - dev volumes: - tactical-data-dev:/opt/tactical - mesh-data-dev:/meshcentral-data - redis-data-dev:/redis/data - mongo-dev-data:/mongo/data/db - ..:/workspace:cached # container for celery worker service celery-dev: container_name: trmm-celery-dev image: api-dev command: [ "tactical-celery-dev" ] restart: always user: 1000:1000 networks: - dev volumes: - tactical-data-dev:/opt/tactical - ..:/workspace:cached depends_on: - postgres-dev - redis-dev # container for celery beat service celerybeat-dev: container_name: trmm-celerybeat-dev image: api-dev command: [ "tactical-celerybeat-dev" ] restart: always user: 1000:1000 networks: - dev volumes: - tactical-data-dev:/opt/tactical - ..:/workspace:cached depends_on: - postgres-dev - redis-dev # container for websockets communication websockets-dev: container_name: trmm-websockets-dev image: api-dev command: [ "tactical-websockets-dev" ] restart: always user: 1000:1000 networks: dev: aliases: - tactical-websockets volumes: - tactical-data-dev:/opt/tactical - ..:/workspace:cached depends_on: - postgres-dev - redis-dev # container for tactical reverse proxy nginx-dev: container_name: trmm-nginx-dev image: ${IMAGE_REPO}tactical-nginx:${VERSION} restart: always user: 1000:1000 environment: APP_HOST: ${APP_HOST} API_HOST: ${API_HOST} MESH_HOST: ${MESH_HOST} CERT_PUB_KEY: ${CERT_PUB_KEY} CERT_PRIV_KEY: ${CERT_PRIV_KEY} APP_PORT: ${APP_PORT} API_PORT: ${API_PORT} DEV: 1 networks: dev: ipv4_address: ${DOCKER_NGINX_IP} ports: - "80:8080" - "443:4443" volumes: - tactical-data-dev:/opt/tactical volumes: tactical-data-dev: null postgres-data-dev: null mongo-dev-data: null mesh-data-dev: null redis-data-dev: null networks: dev: driver: bridge ipam: driver: default config: - subnet: ${DOCKER_NETWORK}