-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
59 lines (49 loc) · 1.63 KB
/
Copy pathDockerfile
File metadata and controls
59 lines (49 loc) · 1.63 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Pull Python 3.8.1 on alpine
FROM python:3.8.1-alpine
# Install the necessary prerequisites for the bot
RUN apk --no-cache add jpeg-dev \
zlib-dev \
freetype-dev \
lcms2-dev \
openjpeg-dev \
tiff-dev \
tk-dev \
tcl-dev \
harfbuzz-dev \
fribidi-dev \
gcc \
musl-dev \
python3-dev \
postgresql-dev \
msttcorefonts-installer \
fontconfig
# Update the fonts cache
RUN update-ms-fonts && \
fc-cache -f && \
rm -rf /var/cache/*
# Create a new user to run as and set the working directory
ENV USER=slackbot
ENV UID=991
ENV GID=991
RUN addgroup -g "${GID}" slackbot
RUN adduser \
--disabled-password \
--gecos "" \
--home "/home/slackbot" \
--ingroup "${USER}" \
--uid "${UID}" \
"${USER}"
USER slackbot
WORKDIR /home/slackbot/
ENV PATH="${PATH}:/home/slackbot/.local/bin"
# Copy the Pipfile, it shouldn't change unless during development
COPY Pipfile Pipfile
# Install the necessary Python environment packages
RUN pip install pipenv
RUN pipenv install Pipfile
# Copy the slackbot script, shouldn't change unless during development
COPY slackbot.py slackbot.py
# This should also later be handled with a mount
COPY slackbot_config.json slackbot_config.json
# Makes it easier to run the container, especially when running individually
ENTRYPOINT [ "pipenv", "run", "python", "slackbot.py" ]