forked from simplcommerce/SimplCommerce
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
27 lines (17 loc) · 1.15 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
FROM simplcommerce/simpl-sdk
ARG source=.
WORKDIR /app
COPY $source .
RUN sed -i 's#<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="1.1.2" />#<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="1.1.0" />#' src/SimplCommerce.WebHost/SimplCommerce.WebHost.csproj
RUN sed -i 's/UseSqlServer/UseNpgsql/' src/SimplCommerce.WebHost/Startup.cs
RUN sed -i 's/UseSqlServer/UseNpgsql/' src/SimplCommerce.WebHost/Extensions/ServiceCollectionExtensions.cs
RUN cd src/SimplCommerce.WebHost && rm Migrations/* && cp -f appsettings.docker.json appsettings.json
RUN dotnet restore && dotnet build
RUN cd src/SimplCommerce.WebHost && npm install && gulp copy-modules
RUN cd src/SimplCommerce.WebHost && dotnet ef migrations add initialSchema
# Don't know why ef migration tool add this.
RUN sed -i '/using SimplCommerce.Module.*.Models;/d' src/SimplCommerce.WebHost/Migrations/SimplDbContextModelSnapshot.cs
RUN sed -i '/using SimplCommerce.Module.*.Models;/d' src/SimplCommerce.WebHost/Migrations/*_initialSchema.Designer.cs
COPY docker-entrypoint.sh /
RUN chmod 755 /docker-entrypoint.sh
ENTRYPOINT ["/docker-entrypoint.sh"]