Skip to content

Commit b3ec308

Browse files
committed
2 parents f365b35 + a993a34 commit b3ec308

File tree

3 files changed

+115
-11
lines changed

3 files changed

+115
-11
lines changed

samples/WebNotifier/Dockerfile

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,24 @@
1-
FROM microsoft/dotnet:2.1.3-aspnetcore-runtime-alpine AS base
2-
WORKDIR /app
3-
4-
ENV ASPNETCORE_URLS http://+:5003
5-
EXPOSE 5003
6-
71
FROM microsoft/dotnet:2.1.401-sdk-alpine AS build
82
WORKDIR .
93
COPY . .
10-
114
WORKDIR /samples/WebNotifier
125

136
RUN dotnet restore -nowarn:msb3202,nu1503
147
RUN dotnet build --no-restore -c Release -o /app
158

169
FROM build AS publish
17-
RUN dotnet publish --no-restore -c Release -o /app
10+
RUN dotnet publish --no-restore -c Release -o /app/
11+
WORKDIR /app
12+
RUN ls -an
1813

19-
FROM base AS final
14+
FROM nginx:alpine
2015
WORKDIR /app
21-
COPY --from=publish /app .
22-
ENTRYPOINT ["dotnet", "WebNotifier.dll"]
16+
COPY --from=publish /app/WebNotifier/dist /usr/share/nginx/html/
17+
WORKDIR /usr/share/nginx/html/
18+
RUN ls -an
19+
COPY --from=build /samples/WebNotifier/nginx.conf /etc/nginx/nginx.conf
20+
COPY --from=build /samples/WebNotifier/mime.types /etc/nginx/mime.types
21+
RUN chmod 0644 /etc/nginx/nginx.conf
22+
RUN chmod 0644 /etc/nginx/nginx.conf
23+
24+
CMD ["nginx", "-g", "daemon off;"]

samples/WebNotifier/mime.types

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
types {
2+
text/html html htm shtml;
3+
text/css css;
4+
text/xml xml;
5+
image/gif gif;
6+
image/jpeg jpeg jpg;
7+
application/x-javascript js;
8+
application/atom+xml atom;
9+
application/rss+xml rss;
10+
11+
text/mathml mml;
12+
text/plain txt;
13+
text/vnd.sun.j2me.app-descriptor jad;
14+
text/vnd.wap.wml wml;
15+
text/x-component htc;
16+
17+
image/png png;
18+
image/tiff tif tiff;
19+
image/vnd.wap.wbmp wbmp;
20+
image/x-icon ico;
21+
image/x-jng jng;
22+
image/x-ms-bmp bmp;
23+
image/svg+xml svg svgz;
24+
image/webp webp;
25+
26+
application/vnd.openxmlformats-officedocument.wordprocessingml.document docx;
27+
application/vnd.openxmlformats-officedocument.presentationml.slideshow ppsx;
28+
application/vnd.openxmlformats-officedocument.presentationml.presentation pptx;
29+
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx;
30+
31+
application/java-archive jar war ear;
32+
application/mac-binhex40 hqx;
33+
application/msword doc;
34+
application/pdf pdf;
35+
application/postscript ps eps ai;
36+
application/rtf rtf;
37+
application/vnd.ms-excel xls;
38+
application/vnd.ms-powerpoint ppt;
39+
application/vnd.wap.wmlc wmlc;
40+
application/vnd.google-earth.kml+xml kml;
41+
application/vnd.google-earth.kmz kmz;
42+
application/x-7z-compressed 7z;
43+
application/x-cocoa cco;
44+
application/x-java-archive-diff jardiff;
45+
application/x-java-jnlp-file jnlp;
46+
application/x-makeself run;
47+
application/x-perl pl pm;
48+
application/x-pilot prc pdb;
49+
application/x-rar-compressed rar;
50+
application/x-redhat-package-manager rpm;
51+
application/x-sea sea;
52+
application/x-shockwave-flash swf;
53+
application/x-stuffit sit;
54+
application/x-tcl tcl tk;
55+
application/x-x509-ca-cert der pem crt;
56+
application/x-xpinstall xpi;
57+
application/xhtml+xml xhtml;
58+
application/zip zip;
59+
60+
application/octet-stream bin exe dll;
61+
application/octet-stream deb;
62+
application/octet-stream dmg;
63+
application/octet-stream eot;
64+
application/octet-stream iso img;
65+
application/octet-stream msi msp msm;
66+
67+
audio/midi mid midi kar;
68+
audio/mpeg mp3;
69+
audio/ogg ogg;
70+
audio/x-realaudio ra;
71+
audio/x-m4a m4a;
72+
73+
video/3gpp 3gpp 3gp;
74+
video/mpeg mpeg mpg;
75+
video/quicktime mov;
76+
video/x-flv flv;
77+
video/x-mng mng;
78+
video/x-ms-asf asx asf;
79+
video/x-ms-wmv wmv;
80+
video/x-msvideo avi;
81+
82+
video/mp4 mp4;
83+
video/webm webm;
84+
video/x-m4v m4v;
85+
application/wasm wasm;
86+
application/json json;
87+
88+
89+
}

samples/WebNotifier/nginx.conf

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
events { }
2+
http {
3+
include /etc/nginx/mime.types;
4+
5+
server {
6+
listen 80;
7+
8+
location / {
9+
root /usr/share/nginx/html;
10+
try_files $uri $uri/ /Index.html =404;
11+
}
12+
}
13+
}

0 commit comments

Comments
 (0)