File tree Expand file tree Collapse file tree 5 files changed +629
-579
lines changed Expand file tree Collapse file tree 5 files changed +629
-579
lines changed Original file line number Diff line number Diff line change @@ -142,9 +142,7 @@ test.py
142142.gitignore
143143.github /
144144app.json
145- CHANGELOG.md
146145Procfile
147146pyproject.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
22
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
46
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
88
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
1012
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
1129ENV USING_DOCKER yes
12- COPY --from=build /inst /usr/local
30+ COPY . .
1331
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"
1212[packages ]
1313aiohttp = " ==3.8.1"
1414colorama = " ~=0.4.5"
15- "discord.py" = " ==2.0.1"
1615emoji = " ==1.7.0"
1716isodate = " ~=0.6.0"
1817motor = " ==2.5.1"
@@ -24,6 +23,12 @@ python-dotenv = "==0.20.0"
2423uvloop = {version = " >=0.15.2" , markers = " sys_platform != 'win32'" }
2524lottie = {version = " ==0.6.11" , extras = [" pdf" ]}
2625requests = " ==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"
2732
2833[scripts ]
2934bot = " python bot.py"
You can’t perform that action at this time.
0 commit comments