forked from scieloorg/opac_proc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile-dev
50 lines (40 loc) · 1.79 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
FROM python:2.7
# FROM python:2.7-alpine # temos que trocar a imagem base para alpine
ENV PYTHONUNBUFFERED 1
ENV DEBIAN_FRONTEND noninteractive
# Build-time metadata as defined at http://label-schema.org
ARG OPAC_PROC_BUILD_DATE
ARG OPAC_PROC_VCS_REF
ARG OPAC_PROC_WEBAPP_VERSION
ENV OPAC_PROC_BUILD_DATE ${OPAC_PROC_BUILD_DATE}
ENV OPAC_PROC_VCS_REF ${OPAC_PROC_VCS_REF}
ENV OPAC_PROC_WEBAPP_VERSION ${OPAC_PROC_WEBAPP_VERSION}
LABEL org.label-schema.build-date=$OPAC_PROC_BUILD_DATE \
org.label-schema.name="OPAC Proc - development build" \
org.label-schema.description="OPAC Proc main app" \
org.label-schema.url="https://github.com/scieloorg/opac_proc/" \
org.label-schema.vcs-ref=$OPAC_PROC_VCS_REF \
org.label-schema.vcs-url="https://github.com/scieloorg/opac_proc/" \
org.label-schema.vendor="SciELO" \
org.label-schema.version=$OPAC_PROC_WEBAPP_VERSION \
org.label-schema.schema-version="1.0"
# pacotes necessários para instalar as deps no alpine. ainda faltam deps para grpc
# RUN apk --update add --no-cache \
# git gcc build-base linux-headers musl-dev python-dev \
# libxml2 libxml2-dev libxml2-utils libxslt-dev py-lxml
RUN apt-get update \
&& apt-get install -qqy --no-install-recommends apt-utils libxml2-utils \
&& rm -rf /var/lib/apt/lists/*
COPY ./requirements.txt /app/requirements.txt
RUN pip --no-cache-dir install -r /app/requirements.txt
COPY ./start_worker.sh /start_worker.sh
RUN sed -i 's/\r//' /start_worker.sh \
&& chmod +x /start_worker.sh \
&& chmod -R +x /src/ \
&& chown nobody /start_worker.sh \
&& chown -R nobody /src/
RUN chown -R nobody:nogroup /app
USER nobody
EXPOSE 8000
WORKDIR /app
CMD gunicorn -k gevent --reload --workers 3 --bind 0.0.0.0:8000 webapp:app --chdir=opac_proc/web/ --log-level DEBUG