Skip to content

Instantly share code, notes, and snippets.

@lucax88x
Created October 10, 2017 17:25
Show Gist options
  • Save lucax88x/6d661c3694a5e96f5e42ec6abcb83765 to your computer and use it in GitHub Desktop.
Save lucax88x/6d661c3694a5e96f5e42ec6abcb83765 to your computer and use it in GitHub Desktop.
dockerfile.write.migrations
FROM microsoft/dotnet:2.0-sdk AS build-env
LABEL Luca Trazzi
COPY ./src /build
WORKDIR /build/Memore.Infrastructure.Write.Migrations
RUN dotnet restore
RUN dotnet build -c Release -o ../out
WORKDIR /build/Memore.Migrator
RUN dotnet restore
RUN dotnet build -c Release -o ../migrator
WORKDIR /build/migrator
ENTRYPOINT ["dotnet", "Memore.Migrator.dll", "-conn", "Server=postgres;Port=5432;Database=memore;User Id=admin;Password=Password6.;", "-assembly", "../out/Memore.Infrastructure.Write.Migrations.dll", "-task", "migrate:up", "-tag" , "main"]
@arialdomartini
Copy link

FROM microsoft/dotnet:2.0-sdk AS build-env
LABEL Luca Trazzi

COPY ./src /build

WORKDIR /build/Memore.Infrastructure.Write.Migrations
RUN dotnet restore
RUN dotnet build -c Release -o ../out

FROM  build-env
WORKDIR /build/Memore.Migrator
RUN dotnet restore
RUN dotnet build -c Release -o ../migrator

FROM microsoft/dotnet:2.0-sdk 
COPY --from=build-env /build/migrator  /migrator
WORKDIR /migrator
ENTRYPOINT ["dotnet", "Memore.Migrator.dll", "-conn", "Server=postgres;Port=5432;Database=memore;User Id=admin;Password=Password6.;", "-assembly", "../out/Memore.Infrastructure.Write.Migrations.dll", "-task", "migrate:up", "-tag" , "main"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment