-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
38 lines (30 loc) · 910 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
FROM python:3.8-alpine
ARG PUID=1000
ARG PGID=1000
ARG TOKEN=needed
ARG HOSTNAME=birdbot
ARG PREFIX=!
ENV PUID=$PUID
ENV PGID=$PGID
ENV TOKEN=$TOKEN
ENV HOSTNAME=$HOSTNAME
ENV PREFIX=$PREFIX
# Installing Kubectl with the binary
RUN apk add sudo && apk add curl
RUN curl -LO https://dl.k8s.io/release/v1.26.3/bin/linux/amd64/kubectl
RUN sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
RUN apk del sudo curl
# Add bot user
RUN adduser --disabled-password --shell /bin/bash botman
ENV LANG en_US.utf8
# home directory
WORKDIR /home/botman
# Adding the actual python script and the requirements we need
ADD birdbot.py /home/botman
COPY requirements.txt /home/botman
# apply permissions
RUN chown -R $PUID:$PGID /home/botman
# switch to user and installing the discord modules under that user
USER botman
RUN pip install -r requirements.txt
CMD ["python","-u","/home/botman/birdbot.py"]