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

save

parent 8a7028e2
Branches
No related tags found
No related merge requests found
.git
.venv
.env
FROM debian:stretch
FROM python:2.7.18-buster
EXPOSE 8000
RUN apt-get update
RUN apt-get install -y software-properties-common
RUN apt-get upgrade -y && apt-get -y install python-virtualenv python-pip unzip libpq-dev python-dev rabbitmq-server
ADD https://github.com/pirati-cz/helios-server/archive/master.zip /helios/
WORKDIR /helios/
RUN mkdir /app
WORKDIR /app
RUN unzip master.zip
COPY requirements.txt .
RUN pip install -r requirements.txt
WORKDIR /helios/helios-server-master/
COPY . .
RUN virtualenv venv
RUN bash -c 'adduser --disabled-login --quiet --gecos app app && \
chmod -R o+r /app/ && \
chmod o+x /app/run.sh'
USER app
RUN bash -c 'source venv/bin/activate; pip install -r requirements.txt'
ADD docker-entrypoint.sh /
RUN adduser --disabled-login --quiet --gecos Helios helios
USER helios
ENTRYPOINT /docker-entrypoint.sh
EXPOSE 8000
CMD ["bash", "run.sh"]
helios:
image: lnovy/helios-docker:latest
environment:
- AUTH_ENABLED_AUTH_SYSTEMS=pirateid
- AUTH_DEFAULT_AUTH_SYSTEM=pirateid
- URL_HOST=https://helios.pirati.cz
restart: always
image: helios
ports:
- 80:80
- "8666:8000"
environment:
DATABASE_URL: "postgres://db:db@host.docker.internal:5432/helios"
AUTH_ENABLED_AUTH_SYSTEMS: pirateid
AUTH_DEFAULT_AUTH_SYSTEM: pirateid
ALLOWED_HOSTS: 127.0.0.1
URL_HOST: http://localhost:8666
SECRET_KEY: "{{ helios_secret_key }}"
EMAIL_HOST: mailgate.pirati.cz
EMAIL_PORT: 587
EMAIL_HOST_USER: XXXXX
EMAIL_HOST_PASSWORD: "{{helios_smtp_password}}"
EMAIL_USE_TLS: 1
DEFAULT_FROM_EMAIL: helios@pirati.cz
DEFAULT_FROM_NAME: Pirati - Helios Voting
DEBUG: 0
WELCOME_MESSAGE: Vítejte na hlasovacím systému České pirátské strany
SITE_TITLE: Hlasovaci system Helios | Ceska piratska strana
#!/bin/bash
trap "echo TRAPed signal" HUP INT QUIT KILL TERM
/etc/init.d/rabbitmq-server start
source venv/bin/activate
python manage.py syncdb
python manage.py migrate
python manage.py celeryd &
python manage.py runserver 0.0.0.0:8000
/etc/init.d/rabbitmq-server stop
bind = "0.0.0.0:8000"
accesslog = "-"
workers = 1
max_requests = 1000
max_requests_jitter = 10
timeout = 60
graceful_timeout = 60
run.sh 0 → 100644
#!/bin/bash
# exit on error
set -e
# migrate database
python manage.py migrate
# start webserver
exec gunicorn -c gunicorn.conf.py wsgi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment