add: wait for alembic to apply changes

v0.2
rrr-marble 4 years ago
parent 0174f4b7ba
commit 1c4664aca8

@ -8,14 +8,19 @@ RUN pip install wheel
RUN pip install -r /app/geodata/requirements.txt RUN pip install -r /app/geodata/requirements.txt
RUN pip install gunicorn uvicorn RUN pip install gunicorn uvicorn
RUN curl --location https://raw.githubusercontent.com/vishnubob/wait-for-it/81b1373f17855a4dc21156cfe1694c31d7d1792e/wait-for-it.sh > /usr/bin/wait-for-it \
&& chmod +x /usr/bin/wait-for-it
EXPOSE 8000 EXPOSE 8000
WORKDIR /app WORKDIR /app
CMD [ \ CMD [ \
"gunicorn", \ "/usr/bin/wait-for-it", "postgres:5432", "--timeout=45", "--strict", \
"--workers=2", \ "--", \
"--worker-class=uvicorn.workers.UvicornWorker", \ # might use exact migration hash here instead of upgrading to the latest "heads"
"--bind=0.0.0.0:8000", \ "alembic", "upgrade", "heads", \
"&&", \
"gunicorn", "--workers=2", "--worker-class=uvicorn.workers.UvicornWorker", "--bind=0.0.0.0:8000", \
"geodata.main:app" \ "geodata.main:app" \
] ]
Loading…
Cancel
Save