-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
79 lines (60 loc) · 2.37 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
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# 2020 Copyright Talaryon Studios
#
# Runtime
#
FROM mcr.microsoft.com/dotnet/aspnet:5.0 as runtime
WORKDIR /
EXPOSE 80 443
RUN mkdir -p /etc/storagr /usr/storagr/bin /usr/storagr/config /usr/storagr/wwwroot
#ln -s /usr/storagr/bin/Storagr /usr/bin/storagr
RUN ln -s /usr/storagr/bin/Storagr.CLI /usr/bin/storagrcli \
&& ln -s /usr/storagr/bin/Storagr.Store /usr/bin/storagrstore \
&& ln -s /usr/storagr/bin/Storagr.UI /usr/bin/storagrui
#ln -s /usr/storagr/config/storagr.json /etc/storagr/storagr.json
RUN ln -s /usr/storagr/config/storagr.store.json /etc/storagr/storagr.store.json \
&& ln -s /usr/storagr/config/storagr.ui.json /etc/storagr/storagr.ui.json \
&& ln -s /usr/storagr/config/storagr.cli.json /etc/storagr/storagr.cli.json
#
# Build
#
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
WORKDIR /src
RUN mkdir -p /app/bin /app/config /app/wwwroot
COPY src/Storagr.Shared Storagr.Shared
COPY src/Storagr.Client Storagr.Client
#COPY src/Storagr Storagr
#RUN dotnet publish "Storagr/Storagr.csproj" -c Release -o /publish \
# && cp /publish/Storagr /app/bin \
# && cp /publish/appsettings.json /bin/config/storagr.json \
# && rm /publish/appsettings.json
COPY src/Storagr.CLI Storagr.CLI
RUN dotnet publish "Storagr.CLI/Storagr.CLI.csproj" -c Release -o /publish \
&& cp /publish/Storagr.CLI /app/bin \
&& cp /publish/appsettings.json /app/config/storagr.cli.json \
&& rm /publish/appsettings.json
COPY src/Storagr.Store Storagr.Store
RUN dotnet publish "Storagr.Store/Storagr.Store.csproj" -c Release -o /publish \
&& cp /publish/Storagr.Store /app/bin \
&& cp /publish/appsettings.json /app/config/storagr.store.json \
&& rm /publish/appsettings.json
COPY src/Storagr.UI Storagr.UI
RUN dotnet publish "Storagr.UI/Storagr.UI.csproj" -c Release -o /publish \
&& cp /publish/Storagr.UI /app/bin \
&& cp /publish/appsettings.json /app/config/storagr.ui.json \
&& rm /publish/appsettings.json
RUN cp -Rf /publish/*.dll /app/bin \
&& cp -Rf /publish/*.deps.json /app/bin \
&& cp -Rf /publish/*.runtimeconfig.json /app/bin \
&& cp -Rf /publish/wwwroot/* /app/wwwroot
#
# Storagr
#
FROM runtime
COPY --from=build /app/bin/* /usr/storagr/bin/
COPY --from=build /app/config/* /usr/storagr/config/
COPY --from=build /app/wwwroot/* /usr/storagr/wwwroot/
ENV STORAGR_SQLITE_DATASOURCE /var/lib/storagr.db
ENV STORE_ROOTPATH /var/lib/store
RUN mkdir -p $STORE_ROOTPATH
CMD bash
#CMD storagr