-
-
Notifications
You must be signed in to change notification settings - Fork 968
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1177 from PokeAPI/deps
Fix building arm6/7 docker image and reduce Docker image size
- Loading branch information
Showing
4 changed files
with
26 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,33 @@ | ||
FROM python:3.10-alpine | ||
FROM python:3.10.16-alpine3.21 AS builder | ||
|
||
ENV PYTHONUNBUFFERED 1 | ||
ENV DJANGO_SETTINGS_MODULE 'config.docker-compose' | ||
ENV PYTHONUNBUFFERED=1 | ||
|
||
RUN mkdir /code | ||
WORKDIR /code | ||
|
||
ADD requirements.txt /code/ | ||
RUN apk add --no-cache postgresql-libs libstdc++ | ||
RUN apk add --no-cache --virtual .build-deps gcc g++ musl-dev \ | ||
postgresql-dev rust cargo && \ | ||
python3 -m pip install -r requirements.txt --no-cache-dir && \ | ||
apk --purge del .build-deps | ||
postgresql-dev binutils rust cargo && \ | ||
python3 -m pip install -r requirements.txt --no-cache-dir | ||
|
||
FROM python:3.10.16-alpine3.21 | ||
|
||
ENV PYTHONUNBUFFERED=1 | ||
ENV DJANGO_SETTINGS_MODULE='config.docker-compose' | ||
|
||
RUN mkdir /code | ||
WORKDIR /code | ||
|
||
COPY --from=builder /usr/local/lib/python3.10/site-packages /usr/local/lib/python3.10/site-packages | ||
COPY --from=builder /usr/local/bin /usr/local/bin | ||
|
||
ADD . /code/ | ||
|
||
RUN addgroup -g 1000 -S pokeapi && \ | ||
adduser -u 1000 -S pokeapi -G pokeapi | ||
|
||
USER pokeapi | ||
CMD gunicorn config.wsgi:application -c gunicorn.conf.py | ||
|
||
CMD ["gunicorn", "config.wsgi:application", "-c", "gunicorn.conf.py"] | ||
|
||
EXPOSE 80 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
Django==3.2.23 | ||
Django==3.2.25 | ||
Unipath==1.1 | ||
coverage==4.5.4 | ||
django-cors-headers==3.14.0 | ||
django-discover-runner==1.0 | ||
django-redis==4.12.1 | ||
django-cachalot==2.4.2 | ||
django-cachalot==2.4.5 | ||
djangorestframework==3.14.0 | ||
gunicorn==21.2.0 | ||
gunicorn==23.0.0 | ||
mimeparse==0.1.3 | ||
psycopg2-binary==2.9.9 | ||
psycopg2-binary==2.9.10 | ||
python-dateutil==2.8.2 | ||
python-mimeparse==1.6.0 | ||
drf-spectacular==0.27.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,2 @@ | ||
-r requirements.txt | ||
pylint===2.8.2 | ||
pylint-django===2.4.4 | ||
astroid==2.5.6 | ||
black==23.11.0 | ||
black==23.12.1 |