Skip to content

Commit 3a3d383

Browse files
committed
pyc files permission fix + nginx user fix + django-rosetta update
1 parent 2bef834 commit 3a3d383

File tree

7 files changed

+14
-9
lines changed

7 files changed

+14
-9
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ A [`cookiecutter`](https://github.com/audreyr/cookiecutter) template for Django/
3939
* Every image has a container_shared directory linked as a volume, so if you want to put something inside the container, or
4040
you want to get something from inside the containers like a backup file you just need to copy everything to this directory.
4141
* Create a bash alias for for the docker-compose by edit the ```.bash_aliases``` file ```alias dc='docker-compose'```
42-
* Enter the container as root: ```dc run --rm django shell root```
42+
* Enter the container as root: ```dc run --rm proxy shell root```
4343
* You can use vim in every container.
4444
* https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-ubuntu-14-04
4545
* better prompt: https://github.com/vertisfinance/gitprompt
@@ -66,7 +66,7 @@ you want to get something from inside the containers like a backup file you just
6666
* django-cleanup: 0.4.2
6767
* django-extensions: 1.6.1
6868
* django-compressor: 2.0
69-
* django-rosetta: 0.7.9 [optional]
69+
* django-rosetta: 0.7.10 [optional]
7070
* django-modeltranslation: 0.11rc2 [optional]
7171
* Commands:
7272
* shell -start a bash shell ```dc run --rm django shell```

req-packages.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ django-cleanup==0.4.2
1212
django-extensions==1.6.1
1313
django-compressor==2.0
1414
django-modeltranslation==0.11
15-
django-rosetta==0.7.9
15+
django-rosetta==0.7.10

{{cookiecutter.repo_name}}/docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ django:
3030
image: {{cookiecutter.repo_name}}-django-python3
3131
entrypoint: ['python3', '/config/run.py']
3232
command: start_runserver
33+
user: developer
3334
volumes_from:
3435
- proxy
3536
volumes:

{{cookiecutter.repo_name}}/docker/base/runutils.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,13 @@ def setuser(username):
118118
groups = list(set(os.getgrouplist(username, gid)))
119119

120120
def chuser():
121-
os.setgroups(groups)
122-
os.setgid(gid)
123-
os.setuid(uid)
124-
os.environ['HOME'] = home
121+
try:
122+
os.setgroups(groups)
123+
os.setgid(gid)
124+
os.setuid(uid)
125+
os.environ['HOME'] = home
126+
except:
127+
pass # Probably the container started as a not root user
125128
return chuser
126129

127130

{{cookiecutter.repo_name}}/docker/django-python3/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@ RUN set -x && apt-get update && DEBIAN_FRONTEND=noninteractive \
2727
apt-get install -y --no-install-recommends gettext
2828
RUN pip3 install \
2929
django-modeltranslation==0.11 \
30-
django-rosetta==0.7.9
30+
django-rosetta==0.7.10
3131
{%- endif %}

{{cookiecutter.repo_name}}/docker/nginx/config/nginx.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
daemon off;
22
worker_processes 2;
3-
user nginx;
3+
user developer;
44

55
error_log stderr info;
66

{{cookiecutter.repo_name}}/production-docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ django:
3030
image: {{cookiecutter.repo_name}}-django-python3
3131
entrypoint: ['python3', '/config/run.py']
3232
command: start_uwsgi
33+
user: developer
3334
volumes_from:
3435
- proxy
3536
volumes:

0 commit comments

Comments
 (0)