Skip to content
Snippets Groups Projects
Commit 92f10c0c authored by jan.bednarik's avatar jan.bednarik
Browse files

Docker deployment setup

parent 7a4cc8a2
No related branches found
No related tags found
No related merge requests found
.git
.venv
.env
FROM python:3.6
RUN mkdir /app
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
RUN bash -c 'adduser --disabled-login --quiet --gecos app app && \
chmod -R o+r /app/ && \
chmod o+x /app/run_server.sh && \
chmod o+x /app/run_worker.sh'
USER app
EXPOSE 8000
CMD ["bash", "run_server.sh"]
...@@ -3,3 +3,13 @@ ...@@ -3,3 +3,13 @@
Fork used by the Czech Pirate Party. Includes PirateID integration and Czech translation. Fork used by the Czech Pirate Party. Includes PirateID integration and Czech translation.
Helios is an end-to-end verifiable voting system. Helios is an end-to-end verifiable voting system.
## Info
větve v gitu:
- `original` je kopie https://github.com/benadida/helios-server
- `master` je z `original` odvozená Pirátská verze nasazená v produkci
- `test` je testovací verze odvozená z `master` nasazená pro testování
Obvykle děláme změny v `test` a když je to ok, releasujeme do `master`.
bind = "0.0.0.0:8000"
accesslog = "-"
workers = 1
max_requests = 1000
max_requests_jitter = 10
timeout = 60
graceful_timeout = 60
#!/bin/bash
# exit on error
set -e
# migrate database
python manage.py migrate
# start webserver
exec gunicorn -c gunicorn.conf.py wsgi
#!/bin/bash
# exit on error
set -e
# start celeryd
exec celery worker --app helios --events --beat --concurrency 1
...@@ -49,7 +49,7 @@ DATABASES = { ...@@ -49,7 +49,7 @@ DATABASES = {
# override if we have an env variable # override if we have an env variable
if get_from_env('DATABASE_URL', None): if get_from_env('DATABASE_URL', None):
import dj_database_url import dj_database_url
DATABASES['default'] = dj_database_url.config(conn_max_age=600, ssl_require=True) DATABASES['default'] = dj_database_url.config(conn_max_age=600)
DATABASES['default']['ENGINE'] = 'django.db.backends.postgresql_psycopg2' DATABASES['default']['ENGINE'] = 'django.db.backends.postgresql_psycopg2'
# Local time zone for this installation. Choices can be found here: # Local time zone for this installation. Choices can be found here:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment