Commit Graph

49 Commits

Author SHA1 Message Date
Fabio C. Barrionuevo da Luz
abba9de2bd Move ARG PYTHON_VERSION=3.9-slim-buster to the global scope
of production Dockerfile to fix #3187 which occurs when
 Gulp is selected as `js_task_runner` on project generation.
2021-05-17 22:22:08 -03:00
Bruno Alla
9e7320ea1b Merge branch 'master' into fix_upgrade_py39
# Conflicts:
#	README.rst
#	{{cookiecutter.project_slug}}/.gitlab-ci.yml
#	{{cookiecutter.project_slug}}/compose/local/django/Dockerfile
#	{{cookiecutter.project_slug}}/compose/production/django/Dockerfile
2021-04-08 18:43:54 +01:00
Arnav Choudhury
2345c2c92d
Update {{cookiecutter.project_slug}}/compose/production/django/Dockerfile
Co-authored-by: Bruno Alla <browniebroke@users.noreply.github.com>
2021-02-24 16:26:58 +05:30
Arnav Choudhury
15453df824 Updated the local and production dockerfiles with more repeatability and easier to update in mind. 2021-02-24 10:58:28 +05:30
Bruno Alla
483b636fcb Only indent with spaces in django Dockerfile 2021-02-23 20:36:52 +00:00
Bruno Alla
ff98d8f517 Remove --use-feature=2020-resolver in pip commands
They are now the default and cause a warning:

WARNING: --use-feature=2020-resolver no longer has any effect, since it is now the default dependency resolver in pip. This will become an error in pip 21.0.
2021-02-23 20:34:41 +00:00
areski
a1d551d067 Update from Python3.8 to Python3.9 2021-01-26 16:13:27 +01:00
Arnav Choudhury
4a52845a26 Replaced copying python package directories with wheel files which are then used to install all requirements. This way the generated images would be a lot more stable as well. Size increases by 2-3mb though 2020-09-16 15:24:16 +05:30
Arnav Choudhury
079db28661 Changed when Requirements are copied and installed to improve incremental image build times. The extra image layer is inconsequential since python-build-stage layers are discarded anyway. 2020-09-14 01:41:33 +05:30
Arnav Choudhury
17e577c924 Fixed Typo with python build stage name that was references incorrectly in the run stage 2020-09-12 11:11:19 +05:30
Arnav Choudhury
a795086b10 Removing using python wheels to build python dependecies due to issue resolving conflicts in package sub-dependencies. Ends up being much more trouble than it's worth. 2020-09-12 11:04:08 +05:30
Arnav Choudhury
53ffbbcf2e Multi stage Python build for Django 2020-09-11 22:00:50 +05:30
Arnav Choudhury
536e86ecad
Traeffik and Django dockerfile changes (#2801) 2020-09-08 09:04:10 +01:00
Bruno Alla
c4e4bea31b Merge branch 'master' into async 2020-04-16 09:43:38 +01:00
Ernesto Cedeno
0cdf60ceac Change Python version to 3.8 2020-03-29 19:55:27 +02:00
Andrew-Chen-Wang
367225e4e8 Removed the 4 workers from the production start of uvicorn 2020-03-24 21:46:40 -04:00
Andrew-Chen-Wang
125ffec243 Changed starting commands for running server
* Performance is very low
2020-03-24 20:51:43 -04:00
Andrew-Chen-Wang
aee2de347b Add uvicorn and web sockets for Django 3
* Add use_async option to cookiecutter.json
* Add websocket configuration
2020-03-24 15:40:14 -04:00
James Williams
d3db7a867f
fix compresss offline never runs using environ 2020-02-28 17:04:15 +00:00
James Williams
89f85f1255
- configure compressor when not using s3
- update django start script to compress if using whitenoise and compress enabled

- add to contributors.rst
2020-02-28 15:59:14 +00:00
Bruno Alla
a0ad9b82b4
Replaced Docker python:3.7-alpine image with python:3.7-slim-bu… (#2391)
Replaced Docker python:3.7-alpine image with python:3.7-slim-buster
2020-01-11 16:46:09 +00:00
Trung Dong Huynh
4a71b0b936 Using the python:3.7-slim-buster image for later Python version - 3.7.6
(instead of debian:buster-slim, shipped with Python 3.7.3)
2020-01-07 13:54:15 +00:00
Trung Dong Huynh
b22045bcd4 Replaced base Docker image with debian:buster-slim (#2373)
Using system Python 3 distribution (3.7.3) in order to allow the use of Debian packages for numpy, scipy, etc. without the need of building them or installing build dependencies.

Changed `#!/bin/sh` in shell scripts to `#!/bin/bash` to make `set -o pipefail` work.
2020-01-07 11:06:31 +00:00
Yuchen Xie
a88b6b04b6 Speed up django image build process, and reduce its size 2019-12-09 09:55:37 +08:00
Nicolas Stefani
7d0f8606ed Update python image to 3.7 2019-09-29 09:41:13 -03:00
Tim Claessens
9b48f922ed Remove all end-of-line carriage returns and not just the first occurrence 2019-06-19 09:46:10 +02:00
Bruno Alla
895298c28f Refactor Celery integration according to current best practices
- Change celery app to not be a Django app, more like a WSGI app
- Define a Celery task in the Django users app
- Write a test to execute the task
- Update scripts to use the new app to start workers
- Update documentation

Fix #865
2019-04-02 15:40:32 +01:00
Bruno Alla
b91c70d755
Add a node image to run Gulp when selecting it with Docker (#1687)
## Description

Following up on @webyneter attempt in #1205, which is now getting outdated, I've tried to make Gulp task runner work with Docker. There is no documentation yet, but this seems to work locally with the custom bootstrap compilation...

- [x] Add a node image for local developement
- [x] Proxy the django image rather than localhost in Browser sync, pass header to keep hostname
- [x] Don't call the runserver command from Gulp, let docker-compose handle
- [x] Update package.json & gulpfile.js templates to reduce the number of unwanted empty lines
- [x] Use [multi-stage build](https://docs.docker.com/develop/develop-images/multistage-build/) in production to make sure the static assets are produced
- [x] Update documentation
- [x] Verify that the previous issue with static assets missing from production isn't there 

## Rationale

Currently, the static build isn't working nicely with Docker, extra manual setup is required.

Fixes #1762
2019-03-25 12:10:55 +00:00
Demetris Stavrou
2c56b2e0e3 Added CELERY_BROKER_URL back to entrypoint and surrounded it with a conditional 2018-06-28 00:30:23 +03:00
Demetris Stavrou
7c69704f9f Moved CELERY_BROKER_URL definition to .django env file to resolve error when Celery is not used (PR #1693) 2018-06-28 00:30:23 +03:00
Nikita Shupeyko
275c13292c
Integrate Flower with Docker Compose setup (#1655)
* Integrate Flower with Docker Compose setup locally

* Remove alien worker celeryd option

* Move Flower COPY section below the worker's

* Remove set -o pipefail command from Flower start script

* Flower client authentication

* Override flower service image name

* Move flower service to the end of local.yml

* Install flower==0.9.2 in all environments

* Introduce production flower service

* Fix local flower start script

* Document Flower integration

* Prettify *.django envs

Rationale: consistency.

* Reference local environment Flower docs from the production's

* 'two more services' -> 'three more services'
2018-06-27 19:33:21 +03:00
Nikita P. Shupeyko
77f61de236 chown django /start-(celerybeat|celeryworker) in production Django 2018-05-25 12:55:27 +03:00
Michel Sassano
c3b9f72f31 Remove openssl to fix unsatisfiable constraints error with libressl (#1661)
Removed the openssl-dev package from the Django Dockerfiles (local and production) to fix the unsatisfiable constraints error.

The error appears because you can't have openssl and libressl installed at the same time. One of the package used by the template/project installs libressl which create an error when trying to install openssl.

Thx to @browniebroke
2018-05-25 14:21:22 +08:00
Nikita P. Shupeyko
6cefe2b9dc Rename gunicorn script to start 2018-05-21 22:28:18 +03:00
Nikita P. Shupeyko
849f64e1a5 Remove .sh ext from executable scripts 2018-05-21 15:20:11 +03:00
Nikita P. Shupeyko
90953a83f2 Alter django entrypoint.sh output 2018-05-21 15:03:37 +03:00
Nikita P. Shupeyko
9b938647b4 Refactor exec "$@" in django entrypoint.sh 2018-05-21 14:59:26 +03:00
Nikita P. Shupeyko
091a3b6d0f gunicorn --bind instead of gunicorn -b 2018-05-14 10:20:27 +03:00
Nikita P. Shupeyko
17739ff263 Refactor POSTGRES_PORT env 2018-05-09 12:58:37 +03:00
Nikita P. Shupeyko
906299ae39 Refactor POSTGRES_HOST env 2018-05-09 12:58:33 +03:00
Nikita P. Shupeyko
26ccf9307f Fix REDIS_URL missing
Fixes #1570.
2018-04-04 13:42:01 +03:00
Nikita P. Shupeyko
2fa5adc2b0 Designate 'postgres' as a variable in entrypoint.sh
Rationale: clarity.
2018-04-04 11:43:39 +03:00
Nikita Shupeyko
59cd5b4849
Celery code blocks are still generated even though Celery is not opted out for (#1587)
* Celery jinja condition in .gitignore

* Celery jinja conditions in Django Dockerfiles

* Re-phrase Django Dockerfile requirements comments

* Remove celery compose dirs through post_gen_project.py
2018-03-27 18:40:44 +03:00
Nikita P. Shupeyko
03ee6c78d6 Fix CELERY_BROKER_URL overriden in entrypoint.sh
Closes #1235.
2018-03-08 19:04:10 +03:00
Nikita P. Shupeyko
5543359382 Distinguish between POSTGRES_DB and POSTGRES_USER
Closes #1301.
2018-03-08 19:04:10 +03:00
Nikita P. Shupeyko
5261956356 Refactor gunicorn -w to be set from WEB_CONCURRENCY env
Closes #1480.
2018-03-05 14:26:43 +03:00
Bruno Alla
0164c330b3 Move to the python:alpine docker image (#1482)
* Move to the python:alpine docker image

- Switch the base images for local and production to alpine
- Install extra dependencies for psycopg2, Pillow and cffi
- Change shebang for shell scripts to use sh instead of bash

* Move to the python:alpine docker image

- Migrate group and user creation to Alpine syntax

* Move to the python:alpine docker image

- Remove `function` keyword, unsupported in shell

* Upgrade various places to the latest Python 3.6

* Test support for translations

* Add gettext library, required for translations support

* Add locale folder for translations support with README documenting it

* Update Changelog

* Tweak command to test translations support
2018-02-22 10:01:05 -05:00
Reggie Riser
f7bd7a5814 Fixing leftovers from migration to Django 1.11 and Python 3.6. 2018-01-03 08:44:54 -05:00
Shupeyko Nikita
188ff966f8 Re-organize compose/ into environment-specific file groups (#1317)
* Re-organize compose/ into environment-specific file groups

Closes #1316.

* Commit missing files

That was weird: git failed to commit one specific folder previously
2017-09-05 14:39:20 +03:00