You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

116 lines
2.6 KiB

services:
# MongoDB service
textbee-db:
container_name: textbee-db
image: mongo:latest
restart: always
environment:
- MONGO_INITDB_ROOT_USERNAME=${MONGO_ROOT_USER}
- MONGO_INITDB_ROOT_PASSWORD=${MONGO_ROOT_PASS}
- MONGO_INITDB_DATABASE=textbee
volumes:
# - ./mongo-init.js:/docker-entrypoint-initdb.d/mongo-init.js:ro
- mongodb_data:/data/db
ports:
- "${MONGO_PORT:-27018}:27017"
networks:
- textbee-network
healthcheck:
test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')"]
interval: 30s
timeout: 10s
retries: 3
start_period: 20s
# MongoDB Express (optional admin UI)
mongo-express:
container_name: textbee-mongo-express
image: mongo-express:latest
restart: always
ports:
- "${MONGO_EXPRESS_PORT:-8081}:8081"
environment:
- ME_CONFIG_MONGODB_ADMINUSERNAME=${MONGO_ROOT_USER}
- ME_CONFIG_MONGODB_ADMINPASSWORD=${MONGO_ROOT_PASS}
- ME_CONFIG_MONGODB_SERVER=textbee-db
depends_on:
textbee-db:
condition: service_healthy
networks:
- textbee-network
# NestJS API
textbee-api:
container_name: textbee-api
# image: ghcr.io/vernu/textbee/api:latest
build:
context: ./api
dockerfile: Dockerfile
restart: always
ports:
- "${API_PORT}:4001"
env_file:
- ./api/.env
environment:
- PORT=${API_PORT}
- REDIS_URL=redis://textbee-redis:6379
healthcheck:
test: ["CMD", "ps", "aux", "| grep", "node"]
interval: 30s
timeout: 10s
retries: 3
start_period: 20s
depends_on:
textbee-db:
condition: service_healthy
networks:
- textbee-network
# Next.js Web
textbee-web:
container_name: textbee-web
# image: ghcr.io/vernu/textbee/web:latest
build:
context: ./web
dockerfile: Dockerfile
restart: always
ports:
- "${WEB_PORT}:3000"
env_file:
- ./web/.env
environment:
- PORT=3000
- NEXT_PUBLIC_API_BASE_URL=${NEXT_PUBLIC_API_BASE_URL}
depends_on:
- textbee-api
networks:
- textbee-network
# Redis (if SMS queue is needed)
textbee-redis:
container_name: textbee-redis
image: redis:alpine
restart: always
ports:
- "${REDIS_PORT:-6379}:6379"
volumes:
- redis_data:/data
networks:
- textbee-network
command: redis-server --appendonly yes
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 30s
timeout: 10s
retries: 3
start_period: 20s
networks:
textbee-network:
driver: bridge
volumes:
mongodb_data:
redis_data: