Skip to content

Commit c96b39c

Browse files
KyleKyle
Kyle
authored and
Kyle
committed
Add nginx.conf
1 parent 38f5877 commit c96b39c

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

Web/Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@ RUN dotnet publish "Web.csproj" -c Release -o /app/publish
1919
FROM base AS final
2020
WORKDIR /app
2121
COPY --from=publish /app/publish .
22+
COPY nginx.conf /etc/nginx/nginx.conf
2223
ENTRYPOINT ["dotnet", "Web.dll"]

Web/nginx.conf

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
events { }
2+
http {
3+
include mime.types;
4+
types {
5+
application/wasm wasm;
6+
}
7+
8+
server {
9+
listen 80;
10+
11+
# Here, we set the location for Nginx to serve the files
12+
# by looking for index.html
13+
location / {
14+
root /usr/local/webapp/nginx/html;
15+
try_files $uri $uri/ /index.html =404;
16+
}
17+
}
18+
}

docker-compose.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ services:
1616
dotnet_app:
1717
build: ./Web
1818
ports:
19-
- "8080:80"
19+
- "8080"
2020
# depends_on:
2121
# - mysql_db
2222

0 commit comments

Comments
 (0)