first commit
This commit is contained in:
49
docker-compose.yml
Normal file
49
docker-compose.yml
Normal file
@@ -0,0 +1,49 @@
|
||||
services:
|
||||
link-shortener:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
container_name: link-shortener-app
|
||||
networks: [isolated]
|
||||
depends_on:
|
||||
redis:
|
||||
condition: service_healthy
|
||||
ports:
|
||||
- "8080:8080"
|
||||
expose:
|
||||
- 8080
|
||||
environment:
|
||||
- SERVER_HOST=localhost
|
||||
- SERVER_PORT=8080
|
||||
- REDIS_URL=redis://redis:6379
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-fsS", "http://localhost:8080/ping"]
|
||||
interval: 5s
|
||||
timeout: 2s
|
||||
retries: 20
|
||||
start_period: 10s
|
||||
|
||||
redis:
|
||||
image: redis:latest
|
||||
container_name: link-shortener-redis
|
||||
networks: [isolated]
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "6379:6379"
|
||||
volumes:
|
||||
- redis_data:/data
|
||||
command: ["redis-server", "--appendonly", "yes"]
|
||||
healthcheck:
|
||||
test: ["CMD", "redis-cli", "ping"]
|
||||
interval: 5s
|
||||
timeout: 3s
|
||||
retries: 5
|
||||
start_period: 10s
|
||||
|
||||
volumes:
|
||||
redis_data:
|
||||
driver: local
|
||||
|
||||
networks:
|
||||
isolated:
|
||||
driver: bridge
|
||||
Reference in New Issue
Block a user