-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
42 lines (34 loc) · 1.16 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
# pull official base image
FROM python:3.10.6-slim-buster
# set working directory
WORKDIR /usr/local/basher/snp_haplotyper
# set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
#ENV FLASK_DEBUG 1
#ENV FLASK_ENV development
ENV SCRIPT_NAME=""
ENV FLASK_APP /usr/local/basher/snp_haplotyper/app.py
ENV PYTHONPATH /usr/local/basher/snp_haplotyper
ENV UPLOAD_FOLDER /var/local/basher/uploads
ENV SESSION_FILE_DIR /var/local/basher/flask_sessions
# only for development
# add and install requirements
COPY ./requirements.txt .
RUN pip3 install -r requirements.txt
USER 0
RUN mkdir -p /var/local/basher/logs/
RUN mkdir -p /var/local/basher/uploads/
RUN mkdir -p /var/local/basher/flask_sessions/
RUN chmod 777 /var/local/basher/logs/
RUN chmod 777 /var/local/basher/uploads/
RUN chmod 777 /var/local/basher/flask_sessions/
USER $CONTAINER_USER_ID
RUN apt-get update && apt-get install -y wkhtmltopdf
# add app
COPY ["snp_haplotyper", "requirements.txt", "tests", "wsgi.py", \
"pytest.ini", ".coverage", "docs", "gunicorn.conf.py", "./"]
COPY ["test_data/AffyID2rsid.txt", "../test_data/AffyID2rsid.txt"]
EXPOSE 5000
# run server
CMD ["gunicorn", "wsgi:app"]