forked from reanahub/reana-workflow-controller
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
57 lines (48 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
56
57
# This file is part of REANA.
# Copyright (C) 2017, 2018, 2019, 2020 CERN.
#
# REANA is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
# Install base image and its dependencies
FROM python:3.8-slim
# hadolint ignore=DL3008, DL3013, DL3015
RUN apt-get update && \
apt-get install -y \
gcc \
git \
vim-tiny && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
pip install --upgrade pip
# Install dependencies
COPY requirements.txt /code/
RUN pip install --no-cache-dir -r /code/requirements.txt
# Copy cluster component source code
WORKDIR /code
COPY . /code
# Are we debugging?
ARG DEBUG=0
RUN if [ "${DEBUG}" -gt 0 ]; then pip install -e ".[debug]"; else pip install .; fi;
# Are we building with locally-checked-out shared modules?
# hadolint ignore=SC2102
RUN if test -e modules/reana-commons; then pip install -e modules/reana-commons[kubernetes] --upgrade; fi
RUN if test -e modules/reana-db; then pip install -e modules/reana-db --upgrade; fi
# Check if there are broken requirements
RUN pip check
# Set useful environment variables
ARG UWSGI_PROCESSES=2
ARG UWSGI_THREADS=2
ENV FLASK_APP=reana_workflow_controller/app.py \
PYTHONPATH=/workdir \
TERM=xterm \
UWSGI_PROCESSES=${UWSGI_PROCESSES:-2} \
UWSGI_THREADS=${UWSGI_THREADS:-2}
# Expose ports to clients
EXPOSE 5000
# Run server
# hadolint ignore=DL3025
CMD uwsgi --module reana_workflow_controller.app:app \
--http-socket 0.0.0.0:5000 --master \
--processes ${UWSGI_PROCESSES} --threads ${UWSGI_THREADS} \
--stats /tmp/stats.socket \
--wsgi-disable-file-wrapper