This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -33,3 +33,5 @@ _UpgradeReport_Files/
|
||||
Thumbs.db
|
||||
Desktop.ini
|
||||
.DS_Store
|
||||
|
||||
.env
|
||||
|
||||
36
Docker/docker-compose.yml
Normal file
36
Docker/docker-compose.yml
Normal file
@@ -0,0 +1,36 @@
|
||||
services:
|
||||
api:
|
||||
image: prtsie/schengen-visa
|
||||
container_name: visa-api
|
||||
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
|
||||
restart: on-failure
|
||||
|
||||
postgres-db:
|
||||
image: postgres:latest
|
||||
container_name: visa-db
|
||||
environment:
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASSWORD: ${POSTGRESPASS}
|
||||
ports:
|
||||
- "5432:5432"
|
||||
networks:
|
||||
- app-network
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U postgres -d auth"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
start_period: 10s
|
||||
|
||||
networks:
|
||||
app-network:
|
||||
driver: bridge
|
||||
@@ -7,6 +7,6 @@ RUN dotnet publish "SchengenVisaApi/SchengenVisaApi.csproj" -c Release -o /app/p
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS runtime
|
||||
WORKDIR /app
|
||||
COPY --from=build /app/publish ./
|
||||
ENV ASPNETCORE_URLS=https://*:5000
|
||||
ENV ASPNETCORE_URLS=http://*:5000
|
||||
EXPOSE 5000
|
||||
ENTRYPOINT ["dotnet", "SchengenVisaApi.dll"]
|
||||
|
||||
@@ -24,7 +24,7 @@ public class Program
|
||||
|
||||
private static async Task HandleMigrationKey(string[] args, WebApplication app)
|
||||
{
|
||||
if (args.Contains(MigrationKey))
|
||||
if (true)
|
||||
{
|
||||
using var scope = app.Services.CreateScope();
|
||||
await using var context = scope.ServiceProvider.GetRequiredService<DatabaseContext>();
|
||||
|
||||
@@ -9,8 +9,6 @@ public static class PipelineRequest
|
||||
app.UseSwagger()
|
||||
.UseSwaggerUI();
|
||||
|
||||
app.UseHttpsRedirection();
|
||||
|
||||
app.UseStatusCodePages();
|
||||
|
||||
app.UseCors("policy");
|
||||
|
||||
Reference in New Issue
Block a user