mirror of
https://github.com/daniviga/bite.git
synced 2025-04-18 22:00:11 +02:00
Add django container
This commit is contained in:
parent
6a10c4fc0d
commit
91276430ac
20
docker/django/Dockerfile
Normal file
20
docker/django/Dockerfile
Normal file
@ -0,0 +1,20 @@
|
||||
FROM python:3.8-alpine AS builder
|
||||
RUN apk update && apk add gcc musl-dev postgresql-dev \
|
||||
&& pip install psycopg2-binary
|
||||
|
||||
# ---
|
||||
|
||||
FROM python:3.8-alpine
|
||||
ENV PYTHONUNBUFFERED 1
|
||||
ENV DJANGO_SETTINGS_MODULE "freedcs.settings"
|
||||
|
||||
RUN apk update && apk add --no-cache postgresql-libs
|
||||
COPY --from=builder /usr/local/lib/python3.8/site-packages/ /usr/local/lib/python3.8/site-packages/
|
||||
COPY --chown=1000:1000 freedcs /srv/app/freedcs
|
||||
COPY --chown=1000:1000 requirements.txt /tmp/requirements.txt
|
||||
|
||||
RUN pip3 install -r /tmp/requirements.txt && rm /tmp/requirements.txt
|
||||
|
||||
USER 1000:1000
|
||||
WORKDIR /srv/app/freedcs
|
||||
CMD ["python3", "manage.py", "runserver"]
|
29
docker/django/production.py.sample
Normal file
29
docker/django/production.py.sample
Normal file
@ -0,0 +1,29 @@
|
||||
# vim: syntax=python
|
||||
|
||||
from freedcs import settings
|
||||
|
||||
# SECURITY WARNING: keep the secret key used in production secret!
|
||||
SECRET_KEY = 'i4z%50+4b4ek(l0#!w2-r1hpo%&r6tk7p$p_-(=6d!c9n=g5m&'
|
||||
|
||||
# SECURITY WARNING: don't run with debug turned on in production!
|
||||
DEBUG = True
|
||||
|
||||
ALLOWED_HOSTS = ['*']
|
||||
|
||||
DATABASES = {
|
||||
'default': {
|
||||
'ENGINE': 'django.db.backends.postgresql',
|
||||
'NAME': 'freedcs',
|
||||
'USER': 'freedcs',
|
||||
'PASSWORD': 'password',
|
||||
'HOST': 'timescale',
|
||||
'PORT': '5432',
|
||||
}
|
||||
}
|
||||
|
||||
MQTT_BROKER = {
|
||||
'HOST': 'rabbitmq',
|
||||
'PORT': 1883,
|
||||
}
|
||||
|
||||
SKIP_WHITELIST = True
|
0
docker/simulator/device_simulator.py
Normal file → Executable file
0
docker/simulator/device_simulator.py
Normal file → Executable file
Loading…
Reference in New Issue
Block a user