Add Docker for WebApi

Added docker-compose && Dockerfile
This commit is contained in:
FUH22860 2023-06-22 21:37:15 +02:00
parent e172b1a820
commit 61180601c1
Signed by: FUH22860
GPG Key ID: 883891A3D2A98580
2 changed files with 29 additions and 0 deletions

6
src/WebApi/Dockerfile Normal file
View File

@ -0,0 +1,6 @@
FROM mcr.microsoft.com/dotnet/sdk:7.0
WORKDIR /App
COPY . ./
RUN dotnet restore
EXPOSE 5226
CMD /usr/bin/dotnet run --project /App/WebApi.csproj

View File

@ -0,0 +1,23 @@
version: "3.4"
services:
y4f-webapi:
build: .
ports:
- "5226:5226"
labels:
- traefik.docker.network=traefik
- traefik.enable=true
- traefik.http.routers.y4f.entrypoints=web-secure
- traefik.http.routers.y4f.rule=Host(`api.y4f.hopeless-cloud.xyz`)
- traefik.http.routers.y4f.tls=true
- traefik.http.routers.y4f.tls.certResolver=default
networks:
- default
- traefik
restart: unless-stopped
networks:
default:
name: y4f-default
external: true
traefik:
external: true