Commit eeb018d0 authored by Lucas Martins's avatar Lucas Martins

Making docker work

parent 78e08e3d
Pipeline #31392615 failed with stage
in 2 minutes and 9 seconds
* * * * * export $(cat /root/env | xargs) && python3 /app/manage.py runcrons smi_unb.data_reader.cronjob.DataCollectCronJob
# Necessary line at end of file to make cron valid
\ No newline at end of file
# Necessary line at end of file to make cron valid
......@@ -4,22 +4,25 @@ RUN apt-get update &&\
apt-get install --no-install-recommends --no-install-suggests -y \
\
# Extra deps
cron \
python3-pip
cron \
libpq-dev \
python3-pip \
postgresql \
postgresql-client
# Base deps
RUN pip3 install \
requests[security] \
django==1.9.8 \
django==2.0.2 \
psycopg2==2.6.2 \
gunicorn \
redis==2.10.3 \
django-redis==4.8.0 \
django-redis==4.3.0 \
invoke \
numpy \
pandas \
Sphinx \
django-polymorphic \
django-polymorphic==2.0.2 \
manuel \
mpld3 \
six \
......@@ -57,4 +60,4 @@ RUN /usr/bin/crontab /etc/cron.d/smi-cron
# Initializing container with script
ADD scripts/start.sh /bin/start.sh
CMD /bin/bash /bin/start.sh
\ No newline at end of file
CMD /bin/bash /bin/start.sh
......@@ -3,9 +3,14 @@
# Exporting all environment variables to use in crontab
env | sed 's/^\(.*\)$/ \1/g' > /root/env
while ! pg_isready -h $DB_SERVICE -p $DB_PORT -q -U $DB_USER; do
>&2 echo "Postgres is unavailable - sleeping..."
sleep 1
done
# Populating database and Initializing cron and gunicorn
python3 manage.py makemigrations && \
python3 manage.py migrate && \
python3 manage.py loaddata src/smi_unb/fixtures/initial_data.json && \
cron && \
gunicorn smi_unb.wsgi -b 0.0.0.0:8000
\ No newline at end of file
gunicorn smi_unb.wsgi -b 0.0.0.0:8000
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment