Skip to content

Commit b87c555

Browse files
committed
🐋 Add docker files
1 parent 274b32e commit b87c555

File tree

2 files changed

+52
-0
lines changed

2 files changed

+52
-0
lines changed

Dockerfile

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# - build project
2+
from mcr.microsoft.com/dotnet/sdk:7.0 as build
3+
workdir /TaleEngine
4+
copy . .
5+
run dotnet restore ".\TaleEngine\TaleEngine\TaleEngine.API.csproj" --disable-parallel
6+
run dotnet publish ".\TaleEngine\TaleEngine\TaleEngine.API.csproj" -c release -o /app --no-restore
7+
8+
# - apply migrations
9+
run dotnet tool install --global dotnet-ef --version 7.0.0
10+
ENV PATH="${PATH}:/root/.dotnet/tools"
11+
# run dotnet ef database update --project ".\TaleEngine\TaleEngine.Data\TaleEngine.Data.csproj"
12+
13+
# - serve env
14+
from mcr.microsoft.com/dotnet/aspnet:7.0
15+
workdir /app
16+
copy --from=build /app ./
17+
18+
expose 5000
19+
20+
entrypoint ["dotnet", "TaleEngine.API.dll"]
21+
22+
# - utils
23+
24+
# build image
25+
# docker build --rm -t dev/taleengine:latest .
26+
27+
# execute docker compose file
28+
# docker-compose build
29+
30+
# run container
31+
# docker run --rm -p 5000:5000 -p 5001:5001 -e ASPNETCORE_HTTP_PORT=https://+:5001 -e ASPNETCORE_URLS=http://+:5000 taleengine-api
32+
# http://localhost:5000/swagger/index.html

docker-compose.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
version: "3.4"
2+
3+
services:
4+
api:
5+
build:
6+
context: .
7+
dockerfile: Dockerfile
8+
ports:
9+
- "8080:80"
10+
depends_on:
11+
- taleenginedb
12+
13+
taleenginedb:
14+
image: "mcr.microsoft.com/mssql/server:2022-latest"
15+
ports:
16+
- "1433:1433"
17+
18+
environment:
19+
SA_PASSWORD: ""
20+
ACCEPT_EULA: "Y"

0 commit comments

Comments
 (0)