From 3ce4d6baf2845981909203480e72fdcd10fdab87 Mon Sep 17 00:00:00 2001 From: mfnefd Date: Wed, 13 Nov 2024 01:49:13 +0400 Subject: [PATCH] =?UTF-8?q?fix:=20dockerfile=20=D0=B8=20docker-compose?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Cloud/Dockerfile | 13 +++++++------ docker-compose.yml | 17 ++++++++--------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Cloud/Dockerfile b/Cloud/Dockerfile index 6de9e42..084ab62 100644 --- a/Cloud/Dockerfile +++ b/Cloud/Dockerfile @@ -9,20 +9,21 @@ ENV ASPNETCORE_URLS=http://+:5124 RUN adduser -u 5678 --disabled-password --gecos "" appuser && chown -R appuser /app USER appuser -FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:6.0 AS build +FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build ARG configuration=Release WORKDIR /src -COPY ["Cloud/Cloud.csproj", "Cloud/"] -RUN dotnet restore "Cloud/Cloud.csproj" +COPY ["Cloud.csproj", "."] +RUN dotnet restore "./Cloud.csproj" COPY . . -WORKDIR "/src/Cloud" -RUN dotnet build "Cloud.csproj" -c $configuration -o /app/build +WORKDIR "/src/." +RUN dotnet build "./Cloud.csproj" -c $configuration -o /app/build FROM build AS publish ARG configuration=Release -RUN dotnet publish "Cloud.csproj" -c $configuration -o /app/publish /p:UseAppHost=false +RUN dotnet publish "./Cloud.csproj" -c $configuration -o /app/publish /p:UseAppHost=false FROM base AS final WORKDIR /app COPY --from=publish /app/publish . ENTRYPOINT ["dotnet", "Cloud.dll"] + diff --git a/docker-compose.yml b/docker-compose.yml index 532e4cb..8503dba 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,22 +1,21 @@ services: cloud: build: ./Cloud/ - ports: + ports: - "5124:5124" depends_on: - postgres postgres: - image: postgres:14 + image: postgres:14 container_name: cucumber_database environment: - POSTGRES_USER: postgres - POSTGRES_PASSWORD: 12345 - POSTGRES_DB: main_database + POSTGRES_USER: postgres + POSTGRES_PASSWORD: 12345 + POSTGRES_DB: main_database ports: - - "5438:5432" + - "5438:5432" volumes: - - postgres_data:/var/lib/postgresql/data - + - postgres_data:/var/lib/postgresql/data volumes: postgres_data: - driver: local \ No newline at end of file + driver: local \ No newline at end of file