Skip to content

Commit 7119717

Browse files
committed
Add docker support
1 parent a4176b4 commit 7119717

File tree

4 files changed

+31
-2
lines changed

4 files changed

+31
-2
lines changed

Dockerfile

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
FROM microsoft/dotnet:2.2-sdk-alpine3.8 AS build
2+
3+
WORKDIR /home/app
4+
5+
COPY . .
6+
7+
RUN dotnet restore ./apps/Mooc/Backend/Backend.csproj
8+
RUN dotnet publish ./apps/Mooc/Backend/Backend.csproj -o /publish/
9+
10+
WORKDIR /publish
11+
12+
ENTRYPOINT ["dotnet", "MoocApps.Backend.dll", "--urls", "http://*:8030"]

README.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
# C# DDD Bootstrap (base / project skeleton)
22

3-
This project is currently in progress.
3+
## Starting the server
4+
* Local using:
5+
* `dotnet run --project apps/Mooc/Backend/Backend.csproj`
6+
* Docker using:
7+
* `docker-compose up`
8+
9+
And then going to http://localhost:8030/health-check to check all is ok.
410

511
## 💡 Related repositories
612

apps/Mooc/Backend/Properties/launchSettings.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"commandName": "Project",
2222
"launchBrowser": true,
2323
"launchUrl": "health-check",
24-
"applicationUrl": "https://localhost:5001;http://localhost:5000",
24+
"applicationUrl": "https://localhost:8031;http://localhost:8030",
2525
"environmentVariables": {
2626
"ASPNETCORE_ENVIRONMENT": "Development"
2727
}

docker-compose.yml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version: '3.0'
2+
3+
services:
4+
mooc.backend:
5+
build:
6+
context: .
7+
dockerfile: Dockerfile
8+
ports:
9+
- "8030:8030"
10+
depends_on:
11+
- mysql

0 commit comments

Comments
 (0)