# # Stage 1, Prebuild # FROM squidex/aspnetcore-build-phantomjs:2.0.3-jessie as builder # Install Google Chrome RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - RUN sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' RUN apt-get update && apt-get install -y google-chrome-stable COPY src/Squidex/package.json /tmp/package.json # Install Node packages RUN cd /tmp && npm install COPY . . WORKDIR / # Build Frontend RUN cp -a /tmp/node_modules /src/Squidex/ \ && cd /src/Squidex \ && npm run test:coverage \ && npm run build:copy \ && npm run build # Test Backend RUN dotnet restore \ && dotnet test tests/Squidex.Infrastructure.Tests/Squidex.Infrastructure.Tests.csproj \ && dotnet test tests/Squidex.Domain.Apps.Core.Tests/Squidex.Domain.Apps.Core.Tests.csproj \ && dotnet test tests/Squidex.Domain.Apps.Entities.Tests/Squidex.Domain.Apps.Entities.Tests.csproj \ && dotnet test tests/Squidex.Domain.Users.Tests/Squidex.Domain.Users.Tests.csproj \ && dotnet test tests/Squidex.Tests/Squidex.Tests.csproj # Publish RUN dotnet publish src/Squidex/Squidex.csproj --output /out/ --configuration Release # # Stage 2, Build runtime # FROM microsoft/aspnetcore:2.0.3-jessie # Default AspNetCore directory WORKDIR /app # Copy from nuild stage COPY --from=builder /out/ . EXPOSE 80 EXPOSE 33333 EXPOSE 40000 ENTRYPOINT ["dotnet", "Squidex.dll"]