Skip to content

Commit 9363fb0

Browse files
Add docker setup for deployment
1 parent 4250145 commit 9363fb0

2 files changed

Lines changed: 39 additions & 0 deletions

File tree

Dockerfile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
FROM microsoft/dotnet:1.1-sdk AS build-env
2+
WORKDIR /app
3+
4+
# copy csproj and restore as distinct layers
5+
COPY RadarrAPI/*.csproj ./
6+
RUN dotnet restore
7+
8+
# copy everything else and build
9+
COPY RadarrAPI/* ./
10+
RUN dotnet publish -c Release -o out
11+
12+
# build runtime image
13+
FROM microsoft/dotnet:1.1-runtime
14+
WORKDIR /app
15+
COPY --from=build-env /app/out ./
16+
ENTRYPOINT ["dotnet", "RadarrAPI.dll"]

docker-compose.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
version: '3'
2+
services:
3+
mysql:
4+
image: mysql
5+
6+
environment:
7+
- MYSQL_ROOT_PASSWORD=
8+
9+
lidarrupdate:
10+
build: .
11+
12+
ports:
13+
- "5001:5000"
14+
15+
links:
16+
- mysql
17+
18+
environment:
19+
- DataDirectory=/data
20+
- Database="server=127.0.0.1;user id=root;password=${MYSQL_ROOT_PASSWORD};database=lidarrupdate;CharSet=utf8mb4"
21+
22+
volumes:
23+
- ./lidarrupdate-data:/data

0 commit comments

Comments
 (0)