-
Notifications
You must be signed in to change notification settings - Fork 7
/
Dockerfile
52 lines (41 loc) · 1.68 KB
/
Dockerfile
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
FROM python:3.11.0-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 libffi-dev
COPY . /app
WORKDIR /app
RUN pip install --upgrade pip
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 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 make compile_messages
RUN chown -R nobody:nogroup /app
VOLUME /app/data
USER nobody
EXPOSE 8000
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 app:app --chdir=/app/opac --timeout 150 --log-level INFO