Explorar el Código

add supervisord to manage django

pull/342/head
Guillaume Vincent hace 8 años
padre
commit
16b9828e6b
Se han modificado 5 ficheros con 33 adiciones y 32 borrados
  1. +15
    -3
      Dockerfile
  2. +0
    -26
      README.md
  3. +2
    -1
      entrypoint.sh
  4. +2
    -2
      requirements.txt
  5. +14
    -0
      supervisord.conf

+ 15
- 3
Dockerfile Ver fichero

@@ -1,6 +1,18 @@
FROM django:onbuild
FROM python:3.5

RUN mkdir /backend
WORKDIR /backend
RUN apt-get update && apt-get install -y \
netcat
supervisor \
netcat \
&& rm -rf /var/lib/apt/lists/*
ADD requirements.txt /backend/
RUN pip install -r requirements.txt
ADD . /backend/

CMD ./start.sh
COPY entrypoint.sh /
RUN chmod 755 /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]

COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
CMD ["/usr/bin/supervisord"]

+ 0
- 26
README.md Ver fichero

@@ -1,26 +0,0 @@
[![Build Status](https://travis-ci.org/lesspass/api.svg?branch=master)](https://travis-ci.org/lesspass/api)

# lesspass-server

lesspass-server is the CRUD API for lesspass

## requirements

* python 3.4

## install

install dependencies

pip install -r requirements.txt

start application

python manage.py runserver


## tests

run tests

python manage.py test

start.sh → entrypoint.sh Ver fichero

@@ -4,4 +4,5 @@ while ! nc -z db 5432; do sleep 3; done

python manage.py migrate
python manage.py collectstatic --clear --no-input
gunicorn lesspass.wsgi:application -w 2 -b :8000

exec "$@"

+ 2
- 2
requirements.txt Ver fichero

@@ -1,5 +1,5 @@
Django==1.9.2
djangorestframework==3.3.2
Django==1.9.4
djangorestframework==3.3.3
djangorestframework-jwt==1.7.2
smartconfigparser==0.1.1
psycopg2==2.6.1


+ 14
- 0
supervisord.conf Ver fichero

@@ -0,0 +1,14 @@
[supervisord]
nodaemon=true
logfile=/dev/null
pidfile=/var/run/supervisord.pid

[program:gunicorn]
directory=/backend
command=gunicorn cscreports.wsgi:application -w 2 -b :8000
autostart=true
autorestart=true
redirect_stderr=true
stdout_logfile=/var/log/lesspass.log
stdout_logfile_maxbytes=5MB
stdout_logfile_backups=5

Cargando…
Cancelar
Guardar