forked from FNNDSC/pfcon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
executable file
·55 lines (49 loc) · 1.65 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
53
54
55
#
# Docker file for pfcon image
#
# Build production image:
#
# docker build -t <name> .
#
# For example if building a local production image:
#
# docker build -t local/pfcon .
#
# Build development image:
#
# docker build --build-arg ENVIRONMENT=local -t <name>:<tag> .
#
# For example if building a local development image:
#
# docker build --build-arg ENVIRONMENT=local -t local/pfcon:dev .
#
# In the case of a proxy (located at say proxy.tch.harvard.edu:3128), do:
#
# export PROXY="http://proxy.tch.harvard.edu:3128"
#
# then add to any of the previous build commands:
#
# --build-arg http_proxy=${PROXY}
#
# For example if building a local development image:
#
# docker build --build-arg http_proxy=${PROXY} --build-arg ENVIRONMENT=local -t local/pfcon:dev .
#
FROM python:3.10.5-bullseye
WORKDIR /app
COPY ./requirements ./requirements
ARG ENVIRONMENT=production
RUN pip install --no-cache-dir -r /app/requirements/$ENVIRONMENT.txt
COPY . .
ARG BUILD_VERSION=unknown
RUN if [ "$ENVIRONMENT" = "local" ]; then pip install -e .; else pip install .; fi
EXPOSE 5005
CMD ["gunicorn", "--bind", "0.0.0.0:5005", "--workers", "8", "--timeout", "3600", "pfcon.wsgi:application"]
LABEL org.opencontainers.image.authors="FNNDSC <dev@babyMRI.org>" \
org.opencontainers.image.title="pfcon" \
org.opencontainers.image.description="ChRIS compute resource controller" \
org.opencontainers.image.url="https://chrisproject.org/" \
org.opencontainers.image.source="https://github.com/FNNDSC/pfcon" \
org.opencontainers.image.version=$BUILD_VERSION \
org.opencontainers.image.revision=$BUILD_VERSION \
org.opencontainers.image.licenses="MIT"