forked from Rappsilber-Laboratory/xiview-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.Dockerfile
42 lines (34 loc) · 1.07 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
FROM python:3.10-slim as build-stage
# Setup env
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONFAULTHANDLER 1
ENV FLASK_DEBUG production
COPY *.whl .
# Install pipenv and compilation dependencies
RUN apt-get update && apt-get install -y gcc g++
RUN python3 -m pip install wheel pip --upgrade && pip install pipenv
RUN apt-get update && apt-get install
COPY Pipfile .
COPY Pipfile.lock .
RUN PIPENV_VENV_IN_PROJECT=1 pipenv install --system
RUN echo 'from xisearch2.cython import *; ' | python
# Create and switch to a new user to ensure security
RUN useradd --create-home appuser
WORKDIR /home/appuser
USER appuser
RUN mkdir -p /home/appuser/logs
# Install application into container
COPY static ./static
COPY templates ./templates
COPY tests ./tests
COPY xiview_server ./xiview_server
COPY .env .
COPY default.database.ini .
COPY logging.ini .
COPY .kubernetes.yml .
#FROM base AS production
# Run the application
#CMD ["python" ,"-m" ,"flask", "run","--host=0.0.0.0"]
ENTRYPOINT waitress-serve --port ${PORT} --url-prefix ${URL_PREFIX} --call ${APP_ENTRY}