forked from bugladen/NadekoBot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
40 lines (34 loc) · 1.16 KB
/
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
40
FROM microsoft/dotnet:2.1-sdk-alpine AS build
COPY . /nadekoBot
WORKDIR /nadekoBot/src/NadekoBot
RUN set -ex; \
dotnet restore; \
dotnet build -c Release; \
dotnet publish -c Release -o /app
WORKDIR /app
RUN set -ex; \
rm libopus.so libsodium.dll libsodium.so opus.dll; \
find . -type f -exec chmod -x {} \;; \
rm -R runtimes/win* runtimes/osx* runtimes/linux-*
FROM microsoft/dotnet:2.1-runtime-alpine AS runtime
WORKDIR /app
COPY --from=build /app /app
RUN set -ex; \
echo '@edge http://dl-cdn.alpinelinux.org/alpine/edge/main' >> /etc/apk/repositories; \
echo '@edge http://dl-cdn.alpinelinux.org/alpine/edge/community' >> /etc/apk/repositories; \
apk add --no-cache \
ffmpeg \
youtube-dl@edge \
libsodium \
opus; \
adduser -D nadeko; \
chown nadeko /app; \
chmod u+w /app; \
install -d -o nadeko -g nadeko -m 755 /app/data
# workaround for the runtime to find the native libs loaded through DllImport
RUN set -ex; \
ln -s /usr/lib/libopus.so.0 /app/libopus.so; \
ln -s /usr/lib/libsodium.so.23 /app/libsodium.so
VOLUME [ "/app/data" ]
USER nadeko
CMD ["dotnet", "/app/NadekoBot.dll"]