-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update compose Dockerfiles * Dockerfile refactoring (#646) * Dockerfile refactoring - Moves the dockerfile to root; enables accessing requirements etc from the dockerfile - got rid of the Dockerfile-dev file because it wasn't being used anywhere. Would be better to add a docker-compose-dev file if we want. - changed the base to official python image - updated some dependencies * switch to python 3.10 * run under a non-root user * fix failing tests by downgrading psycopg2-binary --------- Co-authored-by: Tarashish Mishra <[email protected]>
- Loading branch information
1 parent
df36149
commit b45fc35
Showing
6 changed files
with
33 additions
and
65 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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
FROM python:3.10-slim-bookworm | ||
ARG DEBIAN_FRONTEND=noninteractive | ||
|
||
RUN apt-get update -qq -y \ | ||
&& apt-get install -y curl wget python3 python3-dev python3-pip git \ | ||
libgeos-dev libcurl4-gnutls-dev librtmp-dev python3-gdal libyaml-dev \ | ||
locales nginx supervisor postgresql-client libpq-dev \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | ||
|
||
# Requirements have to be pulled and installed here, otherwise caching won't work | ||
COPY ./requirements /requirements | ||
|
||
RUN pip install -r /requirements/production.txt | ||
|
||
COPY . /app | ||
RUN useradd django | ||
RUN chown -R django:django /app | ||
|
||
COPY ./compose/django/gunicorn.sh /gunicorn.sh | ||
COPY ./compose/django/entrypoint.sh /entrypoint.sh | ||
RUN sed -i 's/\r//' /entrypoint.sh \ | ||
&& sed -i 's/\r//' /gunicorn.sh \ | ||
&& chmod +x /entrypoint.sh \ | ||
&& chmod +x /gunicorn.sh | ||
|
||
WORKDIR /app | ||
USER django | ||
|
||
ENTRYPOINT ["/entrypoint.sh"] |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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