-
Notifications
You must be signed in to change notification settings - Fork 0
/
Containerfile
36 lines (29 loc) · 1.33 KB
/
Containerfile
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
FROM docker.io/library/python:3.9-alpine AS intermediate
LABEL org.opencontainers.image.authors="StelFux <[email protected]>" \
org.opencontainers.image.url="https://github.com/StelFux/red-discordbot-docker/blob/master/README.md" \
org.opencontainers.image.documentation="https://github.com/StelFux/red-discordbot-docker/blob/master/README.md#settings" \
org.opencontainers.image.source="https://github.com/StelFux/red-discordbot-docker" \
org.opencontainers.image.title="Red DiscordBot" \
org.opencontainers.image.description="A multi-function Discord bot"
ENV INSTANCE="bot"
# libstdc++ used by serverstats
RUN apk add --no-cache git openjdk11-jre-headless libstdc++ && \
apk add --no-cache --virtual .build-deps alpine-sdk libffi-dev && \
adduser -D -h /red -g red red && \
su red -c "python -m venv /red/env && \
source /red/env/bin/activate && \
pip install --upgrade --no-cache-dir pip setuptools wheel"
VOLUME /red/data
ADD launch.sh /usr/local/bin
ENTRYPOINT ["/usr/local/bin/launch.sh"]
FROM intermediate AS latest
RUN su red -c "source /red/env/bin/activate && \
pip install --no-cache-dir Red-DiscordBot" && \
apk del .build-deps
USER red:red
FROM intermediate AS postgres
ENV STOCKAGE=postgres
RUN su red -c "source /red/env/bin/activate && \
pip install --no-cache-dir Red-DiscordBot[Postgres]" && \
apk del .build-deps
USER red:red