-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.jinja
35 lines (30 loc) · 1.23 KB
/
Dockerfile.jinja
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
# basic python3 image as base
FROM harbor2.vantage6.ai/infrastructure/algorithm-base
# This is a placeholder that should be overloaded by invoking
# docker build with '--build-arg PKG_NAME=...'
ARG PKG_NAME="{{algorithm_name}}"
# install federated algorithm
COPY . /app
RUN pip install /app
{% if use_vpn %}
# Specify the ports that are used for VPN communication, along with a label
# that helps you identify them. As an example, port 8888 is used here. The label
# must be specified as the port number with a 'p' prefix, e.g. 'p8888'.
{% if vpn_expose %}
{%- for port_dict in vpn_expose %}
EXPOSE {{port_dict.port}}
LABEL p{{port_dict.port}} = '{{port_dict.label}}'
{% endfor %}
{% else %}
# TODO provide a sensible label below. Feel free to add more ports if needed by
# adding additional EXPOSE and LABEL commands.
EXPOSE 8888
LABEL p8888='some_label'
{% endif %}
{% endif %}
# Set environment variable to make name of the package available within the
# docker image.
ENV PKG_NAME=${PKG_NAME}
# Tell docker to execute `wrap_algorithm()` when the image is run. This function
# will ensure that the algorithm method is called properly.
CMD python -c "from vantage6.algorithm.tools.wrap import wrap_algorithm; wrap_algorithm()"