diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml index 7f9c93f..f4e0ce3 100644 --- a/docker-compose.prod.yml +++ b/docker-compose.prod.yml @@ -1,5 +1,22 @@ version: '3.8' services: - rubot: - # Workaround for now to access the local mongodb instance - network_mode: host \ No newline at end of file + mongo-express: + image: mongo-express + container_name: sprechi-mongo-express + environment: + - ME_CONFIG_MONGODB_ADMINUSERNAME=$MONGODB_USER + - ME_CONFIG_MONGODB_ADMINPASSWORD=$MONGODB_PASSWORD + - ME_CONFIG_MONGODB_URL=mongodb://${MONGODB_USER}:${MONGODB_PASSWORD}@db:27017/ + restart: unless-stopped + #ports: + # - 8081:8081 + networks: + - default + - proxy + #depends_on: + # db: + # condition: service_healthy + +networks: + proxy: + external: true \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 0ea04a6..a4ecafc 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,28 +1,30 @@ version: '3.8' services: - rubot: + db: + image: mongo + container_name: sprechi-mongodb + environment: + - MONGO_INITDB_ROOT_USERNAME=$MONGODB_USER + - MONGO_INITDB_ROOT_PASSWORD=$MONGODB_PASSWORD + - MONGO_INITDB_DATABASE=$MONGODB_DBNAME + restart: unless-stopped + #healthcheck: + # test: echo 'db.runCommand({serverStatus:1}).ok' | mongo admin -u $MONGO_INITDB_ROOT_USERNAME -p $MONGO_INITDB_ROOT_PASSWORD --quiet | grep 1 + # interval: 10s + # timeout: 10s + # retries: 5 + # start_period: 20s + + sprechi: build: . image: rubot:latest - container_name: Rubot - restart: unless-stopped + container_name: sprechi + env_file: + - stack.env # works with portainer environment: - - TOKEN=${TOKEN} - - PREFIX=${PREFIX} - - OWNER_ID=${OWNER_ID} - - VERSION=${VERSION} - - CURRENT_SEASON=${CURRENT_SEASON} - - RLSTATS_API_KEY=${RLSTATS_API_KEY} - - GOOGLE_MAPS_API_KEY=${GOOGLE_MAPS_API_KEY} - - STEAM_API_KEY=${STEAM_API_KEY} - - BALLCHASING_API_KEY=${BALLCHASING_API_KEY} - - MYSQL_HOST=${MYSQL_HOST} - - MYSQL_USER=${MYSQL_USER} - - MYSQL_PASSWORD=${MYSQL_PASSWORD} - - MAIN_SCHEMA_NAME=${MAIN_SCHEMA_NAME} - - MONGODB_PASSWORD=${MONGODB_PASSWORD} - - MONGODB_CONNECTION_URL=${MONGODB_CONNECTION_URL} - - RLTRACKER_API_KEY=${RLTRACKER_API_KEY} - - VERIFY_SECRET=${VERIFY_SECRET} - - DISABLE_DM=${DISABLE_DM} - - DM_ONLY_VERIFY=${DM_ONLY_VERIFY} - - DM_VERIFY_GUILD=${DM_VERIFY_GUILD} \ No newline at end of file + - TZ=Europe/Berlin + - MONGODB_CONNECTION_URL=mongodb://${MONGODB_USER}:${MONGODB_PASSWORD}@db:27017/${MONGODB_DBNAME}?authSource=admin + restart: unless-stopped + #depends_on: + # db: + # condition: service_healthy \ No newline at end of file