docker-compose.yml
version: '3.7'
services:
api:
restart: always
build:
context: .
dockerfile: Docker/CubeServer/Dockerfile
target: api
volumes:
- ./config/secret_key.txt:/secret/secret_key.txt
- ./config/server.key:/etc/ssl/api_cert/server.key
- ./config/server.pem:/etc/ssl/api_cert/server.pem
ports:
- "8081:443"
environment:
- MONGODB_HOSTNAME=${MONGODB_HOSTNAME}
- MONGODB_USERNAME=${MONGODB_USERNAME:-flask}
- MONGODB_DATABASE=${MONGODB_DATABASE:-flaskdb}
- LOGLEVEL=${LOGLEVEL:-DEBUG}
- MONGODB_DRIVER=${MONGODB_DRIVER:-mongodb+srv}
- MONGODB_OPTIONS=${MONGODB_OPTIONS:-retryWrites=true&w=majority}
- MONGODB_PASSWORD=${MONGODB_PASSWORD}
profiles:
- api
- full
app:
restart: always
build:
context: .
dockerfile: Docker/CubeServer/Dockerfile
target: app
volumes:
- ./config/secret_key.txt:/secret/secret_key.txt
- ./config/server.pem:/etc/ssl/api_cert/server.pem
ports:
- "8080:80"
environment:
- MONGODB_HOSTNAME=${MONGODB_HOSTNAME}
- MONGODB_USERNAME=${MONGODB_USERNAME:-flask}
- MONGODB_DATABASE=${MONGODB_DATABASE:-flaskdb}
- LOGLEVEL=${LOGLEVEL:-DEBUG}
- MONGODB_DRIVER=${MONGODB_DRIVER:-mongodb+srv}
- MONGODB_OPTIONS=${MONGODB_OPTIONS:-retryWrites=true&w=majority}
- MONGODB_PASSWORD=${MONGODB_PASSWORD}
- AP_SSID=${AP_SSID:-TheCubeProject}
- API_HOST=${API_HOST:-192.168.252.1}
- API_PORT=${API_PORT:-8081}
- STATIC_VERSION=${STATIC_VERSION}
profiles:
- app
- full
mongodb:
restart: always
image: ${MONGODB_IMAGE:-mongodb-raspberrypi4-unofficial-r7.0.3}
volumes:
- mongodb-data:/data/db
environment:
MONGO_INITDB_ROOT_USERNAME: ${MONGODB_USERNAME:-flask}
MONGO_INITDB_ROOT_PASSWORD: ${MONGODB_PASSWORD}
MONGO_INITDB_DATABASE: ${MONGODB_DATABASE:-flaskdb}
MONGODB_DATA_DIR: /data/db
MONDODB_LOG_DIR: /dev/null
profiles:
- full
volumes:
mongodb-data: