# syntax=docker/dockerfile:1 FROM registry.gitlab.teklia.com/arkindex/backend/base:gitlab-teklia as build RUN mkdir build ADD . build RUN cd build && python3 setup.py sdist FROM registry.gitlab.teklia.com/arkindex/backend/base:gitlab-teklia # Install arkindex and its deps # Uses a source archive instead of full local copy to speedup docker build COPY --from=build /build/dist/arkindex-*.tar.gz /tmp/arkindex.tar.gz RUN pip install gunicorn /tmp/arkindex.tar.gz && rm /tmp/arkindex.tar.gz # Allow access to static files directory RUN mkdir -p /backend_static RUN chown -R ark:teklia /backend_static # Copy Version file COPY VERSION /etc/arkindex.version ENV PORT 8000 HEALTHCHECK --start-period=10s --interval=30s --timeout=5s \ CMD wget --spider --quiet http://localhost:$PORT/api/v1/corpus/ || exit 1 # Allow usage of django-admin by exposing our settings ENV DJANGO_SETTINGS_MODULE "arkindex.project.settings" # Run with Gunicorn EXPOSE $PORT CMD arkindex gunicorn --host=0.0.0.0 --port $PORT