-
Notifications
You must be signed in to change notification settings - Fork 22
/
Dockerfile-dev
54 lines (40 loc) · 1.75 KB
/
Dockerfile-dev
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
FROM python:3.6-alpine
ENV PYTHONUNBUFFERED 1
# Build-time metadata as defined at http://label-schema.org
ARG OPAC_BUILD_DATE
ARG OPAC_VCS_REF
ARG OPAC_WEBAPP_VERSION
ENV OPAC_BUILD_DATE ${OPAC_BUILD_DATE}
ENV OPAC_VCS_REF ${OPAC_VCS_REF}
ENV OPAC_WEBAPP_VERSION ${OPAC_WEBAPP_VERSION}
LABEL org.label-schema.build-date=$OPAC_BUILD_DATE \
org.label-schema.name="OPAC WebApp - development build" \
org.label-schema.description="OPAC WebApp main app" \
org.label-schema.url="https://github.com/scieloorg/opac/" \
org.label-schema.vcs-ref=$OPAC_VCS_REF \
org.label-schema.vcs-url="https://github.com/scieloorg/opac/" \
org.label-schema.vendor="SciELO" \
org.label-schema.version=$OPAC_WEBAPP_VERSION \
org.label-schema.schema-version="1.0"
RUN apk --update add --no-cache \
git gcc build-base zlib-dev jpeg-dev curl libxml2-dev libxslt-dev py3-lxml
COPY ./requirements.txt /app/requirements.txt
COPY ./requirements.dev.txt /app/requirements.dev.txt
COPY ./start_worker.sh /start_worker.sh
COPY ./start_scheduler.sh /start_scheduler.sh
RUN sed -i 's/\r//' /start_worker.sh \
&& sed -i 's/\r//' /start_scheduler.sh \
&& chmod +x /start_worker.sh \
&& chmod +x /start_scheduler.sh \
&& chown nobody /start_worker.sh \
&& chown nobody /start_scheduler.sh
RUN pip --no-cache-dir install -U pip && \
pip --no-cache-dir install -r /app/requirements.txt && \
pip --no-cache-dir install -r /app/requirements.dev.txt
RUN chown -R nobody:nogroup /app
USER nobody
EXPOSE 8000
WORKDIR /app
HEALTHCHECK --interval=5m --timeout=3s \
CMD curl -f http://localhost:8000/ || exit 1
CMD gunicorn --worker-class=gevent --worker-connections=1000 --workers 3 --bind 0.0.0.0:8000 manager:app --chdir=/app/opac --log-level DEBUG