Compare commits
	
		
			6 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 6709afa2e0 | |||
| c8bede7df3 | |||
| 669fb7d21c | |||
| fcd2952757 | |||
| 91fbbf97a4 | |||
| 9e7a6b4197 | 
| @@ -1,30 +0,0 @@ | ||||
| #!/bin/bash | ||||
|  | ||||
| set -euo pipefail | ||||
|  | ||||
| BRANCH=$1 | ||||
|  | ||||
| # Директории | ||||
| TEMPLATE_DIR="/deploy/templates" | ||||
| DEPLOY_DIR="/deploy/templates/$BRANCH" | ||||
|  | ||||
| if [ "$BRANCH" = "main" ]; then | ||||
|     TEMPLATE_FILE="docker-compose.template.yml" | ||||
| else | ||||
|     TEMPLATE_FILE="docker-compose.dev-template.yml" | ||||
| fi | ||||
|  | ||||
| # Создаем директорию для деплоя | ||||
| mkdir -p $DEPLOY_DIR | ||||
|  | ||||
| # Копируем и обновляем docker-compose.yml | ||||
| sed "s|{{BRANCH}}|$BRANCH|g" $TEMPLATE_DIR/$TEMPLATE_FILE > $DEPLOY_DIR/docker-compose.yml | ||||
|  | ||||
| # Перезапускаем сервисы | ||||
| cd $DEPLOY_DIR | ||||
| docker-compose down | ||||
| docker-compose pull | ||||
| docker-compose up -d | ||||
|  | ||||
| # Очистка старых образов | ||||
| docker image prune -f | ||||
| @@ -1,34 +0,0 @@ | ||||
| services: | ||||
|   api-dev: | ||||
|     image: git.prtsie.ru/prtsie/schengen-visa-{{BRANCH}} | ||||
|     container_name: visa-api-{{BRANCH}} | ||||
|     ports: | ||||
|       - "5001:5000" | ||||
|     depends_on: | ||||
|       postgres-db-dev: | ||||
|         condition: service_healthy | ||||
|     environment: | ||||
|       - ASPNETCORE_ENVIRONMENT=Development | ||||
|       - ConnectionStrings__connectionString=Host=postgres-db-dev;Port=5432;Database=visa;Username=postgres;Password=Qwerty123456! | ||||
|     networks: | ||||
|       - app-network-{{BRANCH}} | ||||
|  | ||||
|   postgres-db-dev: | ||||
|     image: postgres:latest | ||||
|     container_name: visa-db-{{BRANCH}} | ||||
|     environment: | ||||
|       POSTGRES_USER: postgres | ||||
|       POSTGRES_PASSWORD: Qwerty123456! | ||||
|       POSTGRES_DATABASE: visa | ||||
|     networks: | ||||
|       - app-network-{{BRANCH}} | ||||
|     healthcheck: | ||||
|       test: ["CMD-SHELL", "pg_isready -U postgres -d visa"] | ||||
|       interval: 5s | ||||
|       timeout: 5s | ||||
|       retries: 10 | ||||
|       start_period: 10s | ||||
|  | ||||
| networks: | ||||
|   app-network-{{BRANCH}}: | ||||
|     driver: bridge | ||||
| @@ -1,34 +0,0 @@ | ||||
| services: | ||||
|   api: | ||||
|     image: git.prtsie.ru/prtsie/schengen-visa-{{BRANCH}} | ||||
|     container_name: visa-api-{{BRANCH}} | ||||
|     ports: | ||||
|       - "5000:5000" | ||||
|     depends_on: | ||||
|       postgres-db: | ||||
|         condition: service_healthy | ||||
|     environment: | ||||
|       - ASPNETCORE_ENVIRONMENT=Development | ||||
|       - ConnectionStrings__connectionString=Host=postgres-db;Port=5432;Database=visa;Username=postgres;Password=Qwerty123456! | ||||
|     networks: | ||||
|       - app-network-{{BRANCH}} | ||||
|  | ||||
|   postgres-db: | ||||
|     image: postgres:latest | ||||
|     container_name: visa-db-{{BRANCH}} | ||||
|     environment: | ||||
|       POSTGRES_USER: postgres | ||||
|       POSTGRES_PASSWORD: Qwerty123456! | ||||
|       POSTGRES_DATABASE: visa | ||||
|     networks: | ||||
|       - app-network-{{BRANCH}} | ||||
|     healthcheck: | ||||
|       test: ["CMD-SHELL", "pg_isready -U postgres -d visa"] | ||||
|       interval: 5s | ||||
|       timeout: 5s | ||||
|       retries: 10 | ||||
|       start_period: 10s | ||||
|  | ||||
| networks: | ||||
|   app-network-{{BRANCH}}: | ||||
|     driver: bridge | ||||
| @@ -1,6 +1,6 @@ | ||||
| FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build | ||||
| WORKDIR /src | ||||
| COPY ./ ./ | ||||
| COPY . ./ | ||||
| RUN dotnet restore | ||||
| RUN dotnet publish "SchengenVisaApi/SchengenVisaApi.csproj" -c Release -o /app/publish | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user