init
All checks were successful
Build and Release / release (push) Successful in 45s

This commit is contained in:
2026-03-25 23:22:58 +07:00
parent b8d3589283
commit 87e52357cc
2 changed files with 6 additions and 11 deletions

View File

@@ -17,14 +17,6 @@ jobs:
mkdir -p assets/resources mkdir -p assets/resources
printf "%s" "${{ secrets.ENV_FILE }}" > assets/resources/.env printf "%s" "${{ secrets.ENV_FILE }}" > assets/resources/.env
- name: Stop and remove old containers
run: |
docker compose down || true
- name: Remove unused Docker resources
run: |
docker system prune -a --volumes -f
- name: Deploy to Container - name: Deploy to Container
run: | run: |
docker compose --env-file ./assets/resources/.env up -d --build --remove-orphans docker compose --env-file ./assets/resources/.env up -d --build --remove-orphans

View File

@@ -28,20 +28,23 @@ services:
- history-api-project - history-api-project
migrate: migrate:
image: migrate/migrate build:
context: .
dockerfile_inline: |
FROM migrate/migrate
COPY db/migrations /migrations
container_name: history_migrate container_name: history_migrate
depends_on: depends_on:
db: db:
condition: service_healthy condition: service_healthy
env_file: env_file:
- ./assets/resources/.env - ./assets/resources/.env
volumes:
- ${PWD}/db/migrations:/migrations:ro
entrypoint: entrypoint:
- sh - sh
- -c - -c
- | - |
DB_URL="postgres://$${POSTGRES_USER}:$${POSTGRES_PASSWORD}@db:5432/$${POSTGRES_DB}?sslmode=disable" DB_URL="postgres://$${POSTGRES_USER}:$${POSTGRES_PASSWORD}@db:5432/$${POSTGRES_DB}?sslmode=disable"
# Thêm ls để kiểm tra chắc chắn lúc chạy
ls /migrations ls /migrations
/migrate -path /migrations -database "$$DB_URL" up || \ /migrate -path /migrations -database "$$DB_URL" up || \
(/migrate -path /migrations -database "$$DB_URL" force 8 && \ (/migrate -path /migrations -database "$$DB_URL" force 8 && \