File tree 5 files changed +629
-579
lines changed 5 files changed +629
-579
lines changed Original file line number Diff line number Diff line change @@ -142,9 +142,7 @@ test.py
142
142
.gitignore
143
143
.github /
144
144
app.json
145
- CHANGELOG.md
146
145
Procfile
147
146
pyproject.toml
148
- README.md
149
- Pipfile
150
- Pipfile.lock
147
+ * .md
148
+ . * .json
Original file line number Diff line number Diff line change 1
- FROM python:3.10 as py
1
+ FROM python:3.10-alpine as base
2
2
3
- FROM py as build
3
+ RUN apk add wget git cairo-dev cairo cairo-tools \
4
+ # pillow dependencies
5
+ jpeg-dev zlib-dev freetype-dev lcms2-dev openjpeg-dev tiff-dev tk-dev tcl-dev
4
6
5
- RUN apt update && apt install -y g++ git
6
- COPY requirements.txt /
7
- RUN pip install --prefix=/inst -U -r /requirements.txt
7
+ FROM base AS python-deps
8
8
9
- FROM py
9
+ # Install pipenv and compilation dependencies
10
+ RUN apk update && apk add --virtual build-dependencies build-base gcc libffi-dev
11
+ RUN pip install pipenv
10
12
13
+ # Install python dependencies in /.venv
14
+ COPY Pipfile Pipfile.lock .
15
+ RUN PIPENV_VENV_IN_PROJECT=1 pipenv install --deploy
16
+
17
+ FROM base AS runtime
18
+
19
+ # Copy virtual env from python-deps stage
20
+ COPY --from=python-deps /.venv /.venv
21
+ ENV PATH="/.venv/bin:$PATH"
22
+
23
+ # Create and switch to a new user
24
+ RUN adduser -D modmail
25
+ WORKDIR /home/modmail
26
+ USER modmail
27
+
28
+ # Install application into container
11
29
ENV USING_DOCKER yes
12
- COPY --from=build /inst /usr/local
30
+ COPY . .
13
31
14
- WORKDIR /modmailbot
15
- CMD ["python" , "bot.py" ]
16
- COPY . /modmailbot
32
+ # Run the application
33
+ CMD ["python" , "-m" , "bot" ]
Original file line number Diff line number Diff line change @@ -12,7 +12,6 @@ typing-extensions = "==4.2.0"
12
12
[packages ]
13
13
aiohttp = " ==3.8.1"
14
14
colorama = " ~=0.4.5"
15
- "discord.py" = " ==2.0.1"
16
15
emoji = " ==1.7.0"
17
16
isodate = " ~=0.6.0"
18
17
motor = " ==2.5.1"
@@ -24,6 +23,12 @@ python-dotenv = "==0.20.0"
24
23
uvloop = {version = " >=0.15.2" , markers = " sys_platform != 'win32'" }
25
24
lottie = {version = " ==0.6.11" , extras = [" pdf" ]}
26
25
requests = " ==2.28.1"
26
+ attrs = " ==21.4.0"
27
+ cairocffi = " ==1.3.0"
28
+ cairosvg = " ==2.7.0"
29
+ cffi = " ==1.15.0"
30
+ pillow = " ==9.5.0"
31
+ "discord.py" = " ==2.0.1"
27
32
28
33
[scripts ]
29
34
bot = " python bot.py"
You can’t perform that action at this time.
0 commit comments