Add Docker
This commit is contained in:
4
.dockerignore
Normal file
4
.dockerignore
Normal file
@@ -0,0 +1,4 @@
|
||||
.git
|
||||
.github
|
||||
**/.idea
|
||||
**/.vs
|
||||
8
.env.default
Normal file
8
.env.default
Normal file
@@ -0,0 +1,8 @@
|
||||
DATASOURCE=
|
||||
HOST=
|
||||
HOSTPORT=
|
||||
USERNAME=
|
||||
PASSWORD=
|
||||
DATABASE=
|
||||
BLACKLISTEDFIELDS=
|
||||
HTTPSPORT=
|
||||
10
NuGet.config
Normal file
10
NuGet.config
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<packageSources>
|
||||
<clear />
|
||||
<add key="nuget.org" value="https://www.nuget.org/api/v2/" />
|
||||
</packageSources>
|
||||
<activePackageSource>
|
||||
<add key="All" value="(Aggregate source)" />
|
||||
</activePackageSource>
|
||||
</configuration>
|
||||
12
docker-compose.yml
Normal file
12
docker-compose.yml
Normal file
@@ -0,0 +1,12 @@
|
||||
version: '3'
|
||||
services:
|
||||
api:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: src/RestAPI/Dockerfile
|
||||
ports:
|
||||
- "80:80"
|
||||
container_name: "restapi"
|
||||
env_file:
|
||||
- .env
|
||||
network_mode: host
|
||||
25
src/.dockerignore
Normal file
25
src/.dockerignore
Normal file
@@ -0,0 +1,25 @@
|
||||
**/.classpath
|
||||
**/.dockerignore
|
||||
**/.env
|
||||
**/.git
|
||||
**/.gitignore
|
||||
**/.project
|
||||
**/.settings
|
||||
**/.toolstarget
|
||||
**/.vs
|
||||
**/.vscode
|
||||
**/*.*proj.user
|
||||
**/*.dbmdl
|
||||
**/*.jfm
|
||||
**/azds.yaml
|
||||
**/bin
|
||||
**/charts
|
||||
**/docker-compose*
|
||||
**/Dockerfile*
|
||||
**/node_modules
|
||||
**/npm-debug.log
|
||||
**/obj
|
||||
**/secrets.dev.yaml
|
||||
**/values.dev.yaml
|
||||
LICENSE
|
||||
README.md
|
||||
16
src/RestAPI/Dockerfile
Normal file
16
src/RestAPI/Dockerfile
Normal file
@@ -0,0 +1,16 @@
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0.102-ca-patch-buster-slim AS build
|
||||
WORKDIR /app
|
||||
|
||||
COPY ["src/RestAPI/RestAPI.csproj", "src/RestAPI/"]
|
||||
RUN dotnet restore "src/RestAPI/RestAPI.csproj"
|
||||
COPY . .
|
||||
|
||||
WORKDIR ./src/RestAPI
|
||||
|
||||
RUN dotnet build "RestAPI.csproj" -c Release -o /app/build
|
||||
RUN dotnet publish "RestAPI.csproj" -c Release -o /app/publish
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:5.0
|
||||
WORKDIR /app
|
||||
COPY --from=build /app/publish .
|
||||
ENTRYPOINT ["dotnet", "RestAPI.dll"]
|
||||
Reference in New Issue
Block a user