mhelmer / dockerize-uwsgi-nginx-webpack

Dockerized Django REST Framework + UWSGI, Nginx, Webpack + React + Redux
14 stars 7 forks source link

Where is the docker-compose.dev.yml? #3

Closed oscanog closed 8 years ago

oscanog commented 8 years ago

ERROR: .FileNotFoundError: [Errno 2] No such file or directory: './docker-compose.dev.yml'

mhelmer commented 8 years ago

Hi,

I have updated the structure, but forgot the README. Basically you have one base compose file now, which you will override depending on environment.

In dev, you will just use eg docker-compose <args> which will use docker-compose.yml and docker-compose.override.yml.

For production it would be: docker-compose -f docker-compose.yml -f docker-compose.prod.yml <args>

oscanog commented 8 years ago

I run docker-compose -f docker-compose.yml -f docker-compose.prod.yml build finished building then docker-compose -f docker-compose.yml -f docker-compose.prod.yml run django ./bootstrap-dev

got an error File "", line 986, in _gcd_import File "", line 969, in _find_and_load File "", line 958, in _find_and_load_unlocked File "", line 673, in _load_unlocked File "", line 665, in exec_module File "", line 222, in _call_with_frames_removed File "/srv/django/project/settings/prod.py", line 3, in DEBUG=false NameError: name 'false' is not defined

I think the error is 'false', it must be 'False'

mhelmer commented 8 years ago

Yeah, it should be False. You probably want to set ALLOWED_HOSTS and a different SECRET_KEY in there as well.

oscanog commented 8 years ago
File "/srv/django/.env/lib/python3.5/os.py", line 241, in makedirs
    mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/srv/django/static/admin'

Got a permission error in collectstatic. both in development and production.

I did chown the root directory, same error occurred. May I know what OS are you using?

mhelmer commented 8 years ago

I'm on debian, but I have also used projects based on this on os x and gentoo. I think the issue is that docker volumes are owned by root when they are ceeated and the django/react containers run as uid 1000.

Run docker-compose run ngnix chown -R 1000:1000 /srv/* before collectstatic

oscanog commented 8 years ago

error

Got it working, but return some error, here's the chrome console.

and some missing module of djangorestframework-jwt

mhelmer commented 8 years ago

Cheers! Thanks for reporting. The chrome 'error' is just a warning because redux-form fields contains props that are not valid for dom-elements.

Redux-form 6 does things a bit differently and avoids this problem, so I should update/migrate.

oscanog commented 8 years ago

I'll wait for the update, just play with your current build for now. BTW, thanks for this. this is very neat boilerplate for django react webpack + docker

mhelmer commented 8 years ago

I addressed the above problems, but didn't migrate redux-form yet. So, I will close this one and take care of redux-form for in #4