-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
35 lines (24 loc) · 887 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
FROM python:3.11-slim AS builder
RUN addgroup --gid 1000 redbot && \
adduser --disabled-password --gecos "" --uid 1000 --gid 1000 redbot
WORKDIR /home/redbot
USER redbot
COPY requirements.txt .
RUN pip install --user --no-cache-dir -r requirements.txt
FROM python:3.11-slim
LABEL org.opencontainers.image.description="Red DiscordBot in a container."
RUN apt-get update && apt-get install -y git openjdk-17-jre-headless \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /home/redbot/.local /usr/local/
COPY --from=builder /etc/passwd /etc/passwd
COPY --from=builder /etc/group /etc/group
COPY --chown=1000:1000 entrypoint.sh /entrypoint.sh
ENV REDBOT_NAME="mybot" \
REDBOT_PREFIX="!" \
REDBOT_OWNER=""
WORKDIR /home/redbot/
RUN chmod +x /entrypoint.sh && \
chown -R 1000:1000 /home/redbot
USER 1000
VOLUME /home/redbot/
ENTRYPOINT ["/entrypoint.sh"]