diff --git a/Dockerfile.alpine b/Dockerfile.alpine index 44da5ce..b1eed2a 100644 --- a/Dockerfile.alpine +++ b/Dockerfile.alpine @@ -1,8 +1,19 @@ FROM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS build WORKDIR /app -COPY . . + +# Copy only what is neccesary for the build, +# so that small changes dont reset the whole build +COPY Controllers ./Controllers +COPY Migrations ./Migrations +COPY Model ./Model +COPY Properties ./Properties +COPY Program.cs . +COPY Trazo.csproj . +COPY WeatherForecast.cs . +COPY appsettings.json . + RUN dotnet restore -RUN dotnet publish -c Release -o out +RUN dotnet publish -c Release -r linux-musl-x64 -o out FROM mcr.microsoft.com/dotnet/aspnet:8.0-alpine WORKDIR /app diff --git a/Trazo.http b/Trazo.http deleted file mode 100644 index cde6654..0000000 --- a/Trazo.http +++ /dev/null @@ -1,6 +0,0 @@ -@Trazo_HostAddress = http://localhost:5233 - -GET {{Trazo_HostAddress}}/weatherforecast/ -Accept: application/json - -### diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml new file mode 100644 index 0000000..342e58b --- /dev/null +++ b/docker-compose.prod.yml @@ -0,0 +1,41 @@ +services: + aspnet-prison-prod: + container_name: aspnet-prison-prod + image: trazo-aspnet-prod + ports: + - "5233:8080" + networks: + - aspnet-network + + aspnet-postgres: + image: postgres:latest + container_name: aspnet-postgres + restart: always + environment: + POSTGRES_DB: postgres + POSTGRES_USER: root + POSTGRES_PASSWORD: root + PGDATA: /var/lib/postgresql/data + # ports: + # - '5432:5432' + networks: + - aspnet-network + + aspnet-pgadmin4: + image: elestio/pgadmin:latest + container_name: aspnet-pgadmin + restart: always + environment: + PGADMIN_DEFAULT_EMAIL: admin@admin.com + PGADMIN_DEFAULT_PASSWORD: admin + PGADMIN_LISTEN_PORT: 8080 + ports: + - "8080:8080" + volumes: + - ./servers.json:/pgadmin4/servers.json + networks: + - aspnet-network + +networks: + aspnet-network: + driver: bridge