forked from ThatCoders/BILIBILI-AI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
39 lines (28 loc) · 799 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# Dockerfile
## build
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build-env
WORKDIR ./
COPY . .
RUN dotnet restore
RUN dotnet build --configuration Release --no-restore -o out
## runtime
FROM mcr.microsoft.com/dotnet/aspnet:5.0
WORKDIR /bilibili
# install cron and nano
RUN apt update && apt-get install -y\
cron \
nano \
&& rm -rf /var/lib/apt/lists/*
# make mount point
RUN mkdir /bilibili/config
# copy files from build
COPY --from=build-env ./out .
# copy scripts
COPY ./docker/entry.sh ./docker/job.sh ./docker/template.json /bilibili/
# setup cron
COPY ./docker/crontab /etc/cron.d/bilicron
RUN chmod 0644 /etc/cron.d/bilicron \
&& crontab /etc/cron.d/bilicron \
&& touch /var/log/cron.log
VOLUME ["/bilibili/config"]
ENTRYPOINT ["/bin/bash", "-c", "/bilibili/entry.sh"]