Include /lib and /usr/lib from builder for PIL to work. Use environ_settings to pass config info to Django
This commit is contained in:
parent
11e335bb71
commit
5ce3aa476c
3 changed files with 5 additions and 2 deletions
|
@ -17,6 +17,9 @@ FROM python:3-alpine
|
|||
|
||||
WORKDIR /home/python
|
||||
COPY --from=builder /home/python /home/python
|
||||
COPY --from=builder /lib /lib
|
||||
COPY --from=builder /usr/lib /usr/lib
|
||||
|
||||
ENTRYPOINT ["venv/bin/python"]
|
||||
ENV DJANGO_SETTINGS_MODULE=get_together.environ_settings
|
||||
CMD ["manage.py", "runserver", "0.0.0.0:8000"]
|
||||
|
|
|
@ -66,7 +66,7 @@ file):
|
|||
### Using the docker container
|
||||
```
|
||||
docker build -t get_together .
|
||||
docker run -d --name get_together -p 8000:8000 get_together
|
||||
docker run -e "DEBUG_MODE=True" -e "SECRET_KEY=xxxxx" -e "ALLOWED_HOSTS=localhost,127.0.0.1" -d --name get_together -p 8000:8000 get_together
|
||||
docker exec -it get_together python3 manage.py createsuperuser
|
||||
```
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ def home(request, *args, **kwards):
|
|||
context['city_search'] = False
|
||||
try:
|
||||
g = location.get_geoip(request)
|
||||
if g.latlng is not None and g.latlng[0] is not None and g.latlng[1] is not None:
|
||||
if g.latlng is not None and len(g.latlng) >= 2 and g.latlng[0] is not None and g.latlng[1] is not None:
|
||||
ll = g.latlng
|
||||
context['geoip_lookup'] = True
|
||||
|
||||
|
|
Loading…
Reference in a new issue