-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix build and enable creation of self-sufficient docker images
- Loading branch information
1 parent
4e9f4b8
commit 0e0d6dd
Showing
9 changed files
with
84 additions
and
46 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
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 |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
/media/ | ||
/static/ | ||
/env/ | ||
.env | ||
*.swp | ||
*.diff | ||
*.rej | ||
|
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,12 +1,19 @@ | ||
FROM python:3.6 | ||
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - | ||
RUN apt-get -qq update; apt-get -y install nodejs gettext libgettextpo-dev libgraphviz-dev libz-dev libjpeg-dev libfreetype6-dev python-dev gdal-bin python-numpy | ||
RUN apt-get -qq update; apt-get -y install nodejs gettext libgettextpo-dev libgraphviz-dev libz-dev libjpeg-dev libfreetype6-dev python3-dev gdal-bin python-numpy | ||
RUN npm install -g less bower | ||
RUN pip3 install pipenv | ||
RUN useradd test | ||
RUN chsh test -s /bin/bash | ||
RUN mkdir /home/test ; chown test /home/test ; chgrp test /home/test | ||
WORKDIR "/home/test" | ||
copy Pipfile.lock Pipfile.lock | ||
copy Pipfile Pipfile | ||
RUN su test ; cd /home/test ; pipenv install --python python3 | ||
copy . . | ||
RUN chown -R test /home/test ; chgrp -R test /home/test | ||
RUN su test ; cd /home/test ; pipenv install --python python3 | ||
run mkdir -p /var/log/django | ||
run su test ; cd /home/test ; SECRET_KEY=foo pipenv run python3 manage.py collectstatic --noinput | ||
run su test ; cd /home/test ; SECRET_KEY=foo pipenv run python manage.py collectmedia --noinput | ||
run su test ; cd /home/test ; SECRET_KEY=foo pipenv run python3 manage.py compress | ||
ENTRYPOINT ["./docker-entrypoint.sh"] |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,6 @@ version: '2' | |
services: | ||
web: | ||
build: . | ||
entrypoint: /bin/bash | ||
ports: | ||
- "8033:8000" | ||
links: | ||
|
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,13 @@ | ||
#!/bin/bash | ||
echo Starting Gunicorn. | ||
echo $DJANGO_SETTINGS_MODULE | ||
exec pipenv run gunicorn wsgi:application \ | ||
--name mapapnk \ | ||
--bind 0.0.0.0:${GUNICORN_PORT:-"8000"} \ | ||
--workers ${GUNICORN_NUM_WORKERS:-"2"} \ | ||
--timeout ${GUNICORN_TIMEOUT:-"60"} \ | ||
--preload \ | ||
--log-level=debug \ | ||
--log-file=- \ | ||
--access-logfile=- \ | ||
"$@" |
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