Add docker support
This commit is contained in:
parent
591bf9056b
commit
3f54d070e7
12
.config/dotnet-tools.json
Normal file
12
.config/dotnet-tools.json
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"version": 1,
|
||||
"isRoot": true,
|
||||
"tools": {
|
||||
"dotnet-ef": {
|
||||
"version": "7.0.2",
|
||||
"commands": [
|
||||
"dotnet-ef"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
4
.dockerignore
Normal file
4
.dockerignore
Normal file
@ -0,0 +1,4 @@
|
||||
# database file
|
||||
Database/MyDarlingDb.db
|
||||
Database/MyDarlingDb.db-shm
|
||||
Database/MyDarlingDb.db-wal
|
15
Dockerfile
Normal file
15
Dockerfile
Normal file
@ -0,0 +1,15 @@
|
||||
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
|
||||
WORKDIR /app
|
||||
|
||||
COPY . ./
|
||||
RUN dotnet restore
|
||||
RUN dotnet tool restore
|
||||
RUN dotnet ef database update
|
||||
RUN dotnet publish -c Release -o out
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:6.0
|
||||
EXPOSE 5000
|
||||
WORKDIR /app
|
||||
COPY --from=build /app/out .
|
||||
ENV ASPNETCORE_ENVIRONMENT Production
|
||||
ENTRYPOINT [ "dotnet", "MyDarling.dll", "--urls=http://0.0.0.0:5000" ]
|
15
docker-compose.yml
Normal file
15
docker-compose.yml
Normal file
@ -0,0 +1,15 @@
|
||||
version: '3'
|
||||
|
||||
services:
|
||||
my-darling:
|
||||
build: .
|
||||
container_name: mydarling-net
|
||||
ports:
|
||||
- "5050:5000"
|
||||
volumes:
|
||||
- mydarling-db:/app/Database
|
||||
- mydarling-wwwroot:/app/wwwroot
|
||||
|
||||
volumes:
|
||||
mydarling-db:
|
||||
mydarling-wwwroot:
|
Loading…
Reference in New Issue
Block a user