-
Notifications
You must be signed in to change notification settings - Fork 16
/
Dockerfile-ui
48 lines (39 loc) · 1.28 KB
/
Dockerfile-ui
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
# File: Dockerfile-ui
# Desc: arxiv search ui
# Use:
# docker build --build-arg GIT_COMMIT=$(git rev-parse HEAD) \
# -t "arxiv/arxiv-search" -f ./Dockerfile-ui .
# docker run -it --env-file=env -p 8000:8000 arxiv/arxiv-search
FROM python:3.10.9-buster
ARG GIT_COMMIT
ENV \
APP_HOME=/app \
ELASTICSEARCH_PASSWORD=changeme \
ELASTICSEARCH_SERVICE_HOST=127.0.0.1 \
ELASTICSEARCH_SERVICE_PORT=9200 \
ELASTICSEARCH_SERVICE_PORT_9200_PROTO=http \
GIT_COMMIT=$GIT_COMMIT \
METADATA_ENDPOINT=https://arxiv.org/docmeta_bulk/ \
PIP_DEFAULT_TIMEOUT=100 \
PIP_DISABLE_PIP_VERSION_CHECK=on \
PIP_NO_CACHE_DIR=off \
POETRY_VERSION=1.2.2 \
PYTHONFAULTHANDLER=1 \
PYTHONHASHSEED=random \
PYTHONUNBUFFERED=1 \
TRACE=1
WORKDIR $APP_HOME
COPY poetry.lock pyproject.toml ./
COPY app.py wsgi.py uwsgi.ini ./
COPY schema ./schema
COPY mappings ./mappings
COPY search ./search
RUN echo $GIT_COMMIT > ./git-commit.txt
RUN pip install "gunicorn==20.1.0" "poetry==$POETRY_VERSION"
RUN poetry config virtualenvs.create false && \
poetry install --no-interaction --no-ansi
EXPOSE 8000
# See cicd/cloudbuild-master-pr.yaml for use in integration tests.
ENV GUNICORN gunicorn --bind :8000 \
--workers 1 --threads 8 --timeout 0 wsgi
CMD exec $GUNICORN