[MapCareTech] Add uWGSI to avoid development server and configure port in Compose

parent e4954d15
......@@ -3,8 +3,7 @@ FROM python:3.8-buster
ARG UMAP_VERSION=1.2.1
ENV PYTHONUNBUFFERED=1 \
UMAP_SETTINGS=/srv/umap/settings.py \
PORT=8000
UMAP_SETTINGS=/srv/umap/settings.py
# Create a user account and group to run uMap
RUN mkdir -p /srv/umap/static /srv/umap/uploads && \
......@@ -44,14 +43,15 @@ RUN pip install umap-project==${UMAP_VERSION}
# Install Docker dependencies
RUN pip install -r requirements-docker.txt
COPY entrypoint.sh /
COPY entrypoint.sh .
COPY uwsgi.init .
RUN chmod +x /entrypoint.sh
RUN chmod +x ./entrypoint.sh
RUN chown -R 10001:10001 /srv/umap
USER umap
EXPOSE 8000
ENTRYPOINT [ "/entrypoint.sh" ]
CMD [ "umap", "runserver", "0.0.0.0:8000" ]
ENTRYPOINT [ "/srv/umap/entrypoint.sh" ]
CMD [ "uwsgi", "--ini", "uwsgi.ini" ]
version: '3.7'
volumes:
app_static:
name: umap-caretech-static
app_uploads:
name: umap-caretech-uploads
db:
......@@ -23,12 +21,12 @@ services:
container_name: umap-caretech
env_file: ./secrets/umap.secrets
environment:
- REDIS_URL=redis://redis:6379/0
- SITE_URL=https://carte.caretech.picasoft.net
REDIS_URL: redis://redis:6379/0
SITE_URL: https://carte.caretech.picasoft.net
# Do not allow non-authenticated users to create maps
- LEAFLET_STORAGE_ALLOW_ANONYMOUS=False
LEAFLET_STORAGE_ALLOW_ANONYMOUS: False
PORT: 8000
volumes:
- app_static:/srv/umap/static
- app_uploads:/srv/umap/uploads
- ./settings.py:/srv/umap/settings.py
init: true
......
......@@ -97,3 +97,30 @@ LEAFLET_STORAGE_KEEP_VERSIONS = env.int(
'LEAFLET_STORAGE_KEEP_VERSIONS',
default=10,
)
import sys
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'formatters': {
'verbose': {
'format': '[django] %(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'
}
},
'handlers': {
'console': {
'level': 'DEBUG',
'class': 'logging.StreamHandler',
'stream': sys.stdout,
'formatter': 'verbose'
},
},
'loggers': {
'django': {
'handlers': ['console'],
'level': 'DEBUG',
'propagate': True,
},
},
}
[uwsgi]
http = :$(PORT)
module = umap.wsgi:application
master = True
vacuum = True
max-requests = 5000
processes = 4
enable-threads = true
static-map = /static=/srv/umap/static
static-map = /uploads=/srv/umap/uploads
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment