diff options
Diffstat (limited to 'docker-compose.yml')
| -rw-r--r-- | docker-compose.yml | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..4605e66 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,62 @@ +services: + # PostgreSQL Database + postgres: + image: postgres:18-alpine + container_name: robot-tracker-db + restart: unless-stopped + environment: + POSTGRES_DB: robot_tracker_db + POSTGRES_USER: robot_master + POSTGRES_PASSWORD: roboMaster123 + ports: + - "5432:5432" + volumes: + - postgres_data:/var/lib/postgresql/data + - ./database/init.sql:/docker-entrypoint-initdb.d/init.sql + healthcheck: + test: ["CMD-SHELL", "pg_isready -U robot_master -d robot_tracker_db"] + interval: 10s + timeout: 5s + retries: 5 + + # Redis Cache + redis: + image: redis:7-alpine + container_name: robot-tracker-redis + restart: unless-stopped + command: redis-server --requirepass redispassword + ports: + - "6379:6379" + healthcheck: + test: ["CMD", "redis-cli", "--raw", "incr", "ping"] + interval: 10s + timeout: 5s + retries: 5 + + # Backend API + backend: + build: ./backend + container_name: robot-tracker-backend + restart: unless-stopped + env_file: + - ./backend/.env.docker + ports: + - "3000:3000" + depends_on: + postgres: + condition: service_healthy + redis: + condition: service_healthy + + # Frontend + frontend: + build: ./frontend + container_name: robot-tracker-frontend + restart: unless-stopped + ports: + - "5173:80" + depends_on: + - backend + +volumes: + postgres_data:
\ No newline at end of file |
