feat: update docker-compose.yml with cron and watchtower services
This commit is contained in:
@@ -16,10 +16,25 @@ services:
|
|||||||
- postgres
|
- postgres
|
||||||
command: ["/api"]
|
command: ["/api"]
|
||||||
|
|
||||||
|
cron:
|
||||||
|
build: .
|
||||||
|
environment:
|
||||||
|
- REDIS_ADDR=redis:6379
|
||||||
|
- POSTGRES_DATABASE=trip_planner
|
||||||
|
- POSTGRES_USER=trip_planner
|
||||||
|
- POSTGRES_PASSWORD=trip_planner
|
||||||
|
- POSTGRES_HOST=postgres
|
||||||
|
depends_on:
|
||||||
|
- redis
|
||||||
|
- postgres
|
||||||
|
command: ["/cron"]
|
||||||
|
|
||||||
redis:
|
redis:
|
||||||
image: redis:7-alpine
|
image: redis:7-alpine
|
||||||
ports:
|
ports:
|
||||||
- "6379:6379"
|
- "6379:6379"
|
||||||
|
volumes:
|
||||||
|
- redis_data:/data
|
||||||
|
|
||||||
postgres:
|
postgres:
|
||||||
image: postgres:15-alpine
|
image: postgres:15-alpine
|
||||||
@@ -32,5 +47,12 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- postgres_data:/var/lib/postgresql/data
|
- postgres_data:/var/lib/postgresql/data
|
||||||
|
|
||||||
|
watchtower:
|
||||||
|
image: nickfedor/watchtower:latest
|
||||||
|
volumes:
|
||||||
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
|
command: --interval 60 --cleanup travel-api
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
postgres_data:
|
postgres_data:
|
||||||
|
redis_data:
|
||||||
@@ -60,10 +60,10 @@
|
|||||||
- [x] verify multi-stage structure produces minimal runtime image (27.1MB)
|
- [x] verify multi-stage structure produces minimal runtime image (27.1MB)
|
||||||
|
|
||||||
### Task 2: Update docker-compose.yml
|
### Task 2: Update docker-compose.yml
|
||||||
- [ ] add `cron` service (Go cron binary, depends_on: postgres, redis)
|
- [x] add `cron` service (Go cron binary, depends_on: postgres, redis)
|
||||||
- [ ] add `watchtower` service (nickfedor/watchtower image, volume for docker.sock, command for cleanup)
|
- [x] add `watchtower` service (nickfedor/watchtower image, volume for docker.sock, command for cleanup)
|
||||||
- [ ] add `redis_data` volume to volumes section
|
- [x] add `redis_data` volume to volumes section
|
||||||
- [ ] verify docker-compose.yml syntax with `docker-compose config`
|
- [x] verify docker-compose.yml syntax with `docker-compose config`
|
||||||
|
|
||||||
### Task 3: Create Gitea Actions CI/CD Workflow
|
### Task 3: Create Gitea Actions CI/CD Workflow
|
||||||
- [ ] create `.gitea/workflows/deploy.yml` file
|
- [ ] create `.gitea/workflows/deploy.yml` file
|
||||||
|
|||||||
Reference in New Issue
Block a user