forked from Squidex/squidex
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
63 lines (47 loc) · 1.67 KB
/
Copy pathDockerfile
File metadata and controls
63 lines (47 loc) · 1.67 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#
# Stage 1, Prebuild
#
FROM squidex/dotnet:2.2-sdk-chromium-phantomjs-node as builder
ARG SQUIDEX__VERSION=1.0.0
WORKDIR /src
# Copy Node project files.
COPY src/Squidex/package*.json /tmp/
# Install Node packages
RUN cd /tmp && npm install --loglevel=error
# Copy nuget project files.
COPY /**/**/*.csproj /tmp/
# Copy nuget.config for package sources.
COPY NuGet.Config /tmp/
# Install nuget packages
RUN bash -c 'pushd /tmp; for p in *.csproj; do dotnet restore $p --verbosity quiet; true; done; popd'
COPY . .
# Build Frontend
RUN cp -a /tmp/node_modules src/Squidex/ \
&& cd src/Squidex \
&& npm run test:coverage \
&& npm run build
# Test Backend
RUN dotnet test tests/Squidex.Infrastructure.Tests/Squidex.Infrastructure.Tests.csproj --filter Category!=Dependencies \
&& 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.Web.Tests/Squidex.Web.Tests.csproj
# Publish
RUN dotnet publish src/Squidex/Squidex.csproj --output /out/alpine --configuration Release -r alpine.3.7-x64 -p:version=$SQUIDEX__VERSION
#
# Stage 2, Build runtime
#
FROM mcr.microsoft.com/dotnet/core/runtime-deps:2.2-alpine3.8
# Default AspNetCore directory
WORKDIR /app
# add libuv & curl
RUN apk update \
&& apk add --no-cache libc6-compat \
&& apk add --no-cache libuv \
&& apk add --no-cache curl \
&& ln -s /usr/lib/libuv.so.1 /usr/lib/libuv.so
# Copy from build stage
COPY --from=builder /out/alpine .
EXPOSE 80
EXPOSE 11111
ENTRYPOINT ["./Squidex"]