Add a postgres database container.

- Set environemnt variables for Postgresql database in the compose file
- Set environment variables for uwsgi in the compose file
- Check if the postgresql container is up and accepting connections before
  running any actual services.
This commit is contained in:
Abhilash Raj
2017-03-29 21:58:40 -07:00
parent c110bb1d01
commit 131d1c0b8a
5 changed files with 92 additions and 16 deletions

View File

@@ -5,6 +5,7 @@ MAINTAINER Abhilash Raj
RUN apt-get update \
&& apt-get install -y ruby-sass \
git \
postgresql-client \
&& python -m pip install git+https://gitlab.com/mailman/mailmanclient.git \
git+https://gitlab.com/mailman/postorius.git \
git+https://gitlab.com/mailman/django-mailman3.git \
@@ -15,21 +16,13 @@ RUN apt-get update \
ADD mailman-web /opt/mailman-web
ADD assets/run.sh /opt/run.sh
WORKDIR /opt/mailman-web
EXPOSE 8000
# ENV DJANGO_SETTINGS_MODULE=mailman-web.settings
ENV UWSGI_WSGI_FILE=wsgi.py UWSGI_HTTP=:8000 UWSGI_WORKERS=2 \
UWSGI_THREADS=4
CMD python manage.py collectstatic --noinput \
&& python manage.py migrate \
&& uwsgi --http-auto-chunked --http-keepalive
#ADD assets/run.sh /opt/run.sh
#ENTRYPOINT /opt/run.sh
# CMD ["uwsgi", "--http-auto-chunked", "--http-keepalive"]
CMD ["/opt/run.sh"]