Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(docker): Fix dbmirgrator docker image
Browse files Browse the repository at this point in the history
AlmarAubel committed Dec 29, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent e00d241 commit fd313b3
Showing 2 changed files with 13 additions and 8 deletions.
5 changes: 3 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -18,6 +18,7 @@ services:

mymeetingsdb:
build: ./src/Database/
platform: linux/amd64
ports:
- 1445:1433
networks:
@@ -26,8 +27,8 @@ services:
migrator:
container_name: mymeetings_db_migrator
build:
context: ./src/Database/
dockerfile: Dockerfile_DatabaseMigrator
context: ./src/
dockerfile: ./Database/Dockerfile_DatabaseMigrator
networks:
- starfish-crm-network
environment:
16 changes: 10 additions & 6 deletions src/Database/Dockerfile_DatabaseMigrator
Original file line number Diff line number Diff line change
@@ -4,12 +4,16 @@ WORKDIR /app
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
WORKDIR /src

COPY ["DatabaseMigrator/DatabaseMigrator.csproj", "DatabaseMigrator.csproj"]
COPY ["DatabaseMigrator/DatabaseMigrator.csproj", "DatabaseMigrator.csproj"]
COPY ["./Database/DatabaseMigrator/DatabaseMigrator.csproj", "DatabaseMigrator.csproj"]
COPY ["Directory.Packages.props", "Directory.Packages.props"]
COPY ["Directory.Build.targets", "Directory.Build.targets"]
COPY ["Directory.Build.props", "Directory.Build.props"]
COPY ["stylecop.json", "stylecop.json"]
COPY [".editorconfig", ".editorconfig"]

RUN dotnet restore "DatabaseMigrator.csproj"

COPY . .
COPY ./Database/ .

WORKDIR "/src"
RUN dotnet build "DatabaseMigrator.csproj" -c Release -o /app/build
@@ -21,11 +25,11 @@ FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .

ADD entrypoint_DatabaseMigrator.sh /
ADD CompanyName.MyMeetings.Database/Scripts/Migrations /migrations/
ADD ./Database/entrypoint_DatabaseMigrator.sh /
ADD ./Database/CompanyName.MyMeetings.Database/Scripts/Migrations /migrations/

# Copy wait-for-it.sh into our image
COPY wait-for-it.sh wait-for-it.sh
COPY ./Database/wait-for-it.sh wait-for-it.sh
# Make it executable, in Linux
RUN chmod +x wait-for-it.sh

0 comments on commit fd313b3

Please sign in to comment.