chore(Dockerfile): remove unused COPY command for db directory
refactor(docker-compose.yml): add healthcheck to ensure database service is healthy before starting the server feat(docker-compose.yml): add condition to wait for database service to be ready before starting the server
This commit is contained in:
parent
bcddfd279d
commit
aecc164a7c
@ -8,7 +8,6 @@ RUN dotnet restore "src/DiIiS-NA/Blizzless.csproj"
|
||||
|
||||
# Copy the rest of the project files and build the application
|
||||
COPY ["src/", "src/"]
|
||||
COPY ["db/", "db/"]
|
||||
WORKDIR "/app/src/DiIiS-NA"
|
||||
RUN dotnet publish "Blizzless.csproj" -c Release --runtime linux-x64 --self-contained true -o /app/publish
|
||||
|
||||
|
||||
@ -5,7 +5,8 @@ services:
|
||||
dockerfile: Dockerfile
|
||||
container_name: diiis-na-server
|
||||
depends_on:
|
||||
- db
|
||||
- db:
|
||||
condition: service_healthy
|
||||
|
||||
db:
|
||||
image: postgres:17
|
||||
@ -17,6 +18,11 @@ services:
|
||||
volumes:
|
||||
- db-data:/var/lib/postgresql/data
|
||||
- ./db/initdb:/docker-entrypoint-initdb.d
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U postgres"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
volumes:
|
||||
db-data:
|
||||
|
||||
Loading…
Reference in New Issue
user.block.title