1
0
mirror of https://github.com/bitwarden/server.git synced 2025-05-27 06:14:51 -05:00

Fix Dockerfiles

This commit is contained in:
Vince Grassia 2023-11-15 16:13:49 -05:00
parent 9381577f66
commit e8e7820ef6
No known key found for this signature in database
GPG Key ID: 9AD7505E8448CC08
2 changed files with 9 additions and 20 deletions

View File

@ -19,42 +19,29 @@ RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
# Copy csproj files as distinct layers # Copy csproj files as distinct layers
WORKDIR /source WORKDIR /source
COPY src/Admin/*.csproj ./src/Admin/ COPY src/Identity/*.csproj ./src/Identity/
COPY src/Core/*.csproj ./src/Core/ COPY src/Core/*.csproj ./src/Core/
COPY src/Infrastructure.Dapper/*.csproj ./src/Infrastructure.Dapper/ COPY src/Infrastructure.Dapper/*.csproj ./src/Infrastructure.Dapper/
COPY src/Infrastructure.EntityFramework/*.csproj ./src/Infrastructure.EntityFramework/ COPY src/Infrastructure.EntityFramework/*.csproj ./src/Infrastructure.EntityFramework/
COPY src/SharedWeb/*.csproj ./src/SharedWeb/ COPY src/SharedWeb/*.csproj ./src/SharedWeb/
COPY util/Migrator/*.csproj ./util/Migrator/
COPY util/MySqlMigrations/*.csproj ./util/MySqlMigrations/
COPY util/PostgresMigrations/*.csproj ./util/PostgresMigrations/
COPY util/SqliteMigrations/*.csproj ./util/SqliteMigrations/
COPY bitwarden_license/src/Commercial.Core/*.csproj ./bitwarden_license/src/Commercial.Core/
COPY bitwarden_license/src/Commercial.Infrastructure.EntityFramework/*.csproj ./bitwarden_license/src/Commercial.Infrastructure.EntityFramework/
COPY Directory.Build.props . COPY Directory.Build.props .
# Restore Admin project dependencies and tools # Restore Identity project dependencies and tools
WORKDIR /source/src/Admin WORKDIR /source/src/Identity
RUN . /tmp/rid.txt && dotnet restore -r $RID RUN . /tmp/rid.txt && dotnet restore -r $RID
# Copy required project files # Copy required project files
WORKDIR /source WORKDIR /source
COPY src/Admin/. ./src/Admin/ COPY src/Identity/. ./src/Identity/
COPY src/Core/. ./src/Core/ COPY src/Core/. ./src/Core/
COPY src/Infrastructure.Dapper/. ./src/Infrastructure.Dapper/ COPY src/Infrastructure.Dapper/. ./src/Infrastructure.Dapper/
COPY src/Infrastructure.EntityFramework/. ./src/Infrastructure.EntityFramework/ COPY src/Infrastructure.EntityFramework/. ./src/Infrastructure.EntityFramework/
COPY src/SharedWeb/. ./src/SharedWeb/ COPY src/SharedWeb/. ./src/SharedWeb/
COPY util/Migrator/. ./util/Migrator/
COPY util/MySqlMigrations/. ./util/MySqlMigrations/
COPY util/PostgresMigrations/. ./util/PostgresMigrations/
COPY util/SqliteMigrations/. ./util/SqliteMigrations/
COPY util/EfShared/. ./util/EfShared/
COPY bitwarden_license/src/Commercial.Core/. ./bitwarden_license/src/Commercial.Core/
COPY bitwarden_license/src/Commercial.Infrastructure.EntityFramework/. ./bitwarden_license/src/Commercial.Infrastructure.EntityFramework/
COPY .git/. ./.git/ COPY .git/. ./.git/
# Build Admin app # Build Identity app
WORKDIR /source/src/Admin WORKDIR /source/src/Identity
RUN . /tmp/rid.txt && dotnet publish -c release -o /app/Admin --no-restore --no-self-contained -r $RID RUN . /tmp/rid.txt && dotnet publish -c release -o /app/Identity --no-restore --no-self-contained -r $RID
WORKDIR /app WORKDIR /app

View File

@ -19,6 +19,7 @@ RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
# Copy csproj files as distinct layers # Copy csproj files as distinct layers
WORKDIR /source WORKDIR /source
COPY src/Core/*.csproj ./src/Core/
COPY util/Migrator/*.csproj ./util/Migrator/ COPY util/Migrator/*.csproj ./util/Migrator/
COPY util/Setup/*.csproj ./util/Setup/ COPY util/Setup/*.csproj ./util/Setup/
COPY Directory.Build.props . COPY Directory.Build.props .
@ -29,6 +30,7 @@ RUN . /tmp/rid.txt && dotnet restore -r $RID
# Copy required project files # Copy required project files
WORKDIR /source WORKDIR /source
COPY src/Core/. ./src/Core/
COPY util/Migrator/. ./util/Migrator/ COPY util/Migrator/. ./util/Migrator/
COPY util/Setup/. ./util/Setup/ COPY util/Setup/. ./util/Setup/
COPY .git/. ./.git/ COPY .git/. ./.git/