aboutsummaryrefslogtreecommitdiff
path: root/docker/cyborg/cyborg-api/Dockerfile.j2
blob: 0d18572205623f937e10f488d4800ecfd9d33533 (plain)
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 {{ namespace }}/{{ image_prefix }}cyborg-base:{{ tag }}
LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}"

{% block cyborg_api_header %}{% endblock %}
{% import "macros.j2" as macros with context %}

{% if install_type == 'binary' %}

RUN echo '{{ install_type }} not yet available for {{ base_distro }}'  \
    && /bin/false

{% elif install_type == 'source' %}
    {% if base_distro in ['centos', 'oraclelinux', 'rhel'] %}
        {% set cyborg_api_packages = [
            'mod_ssl',
            'mod_wsgi'
        ] %}
    {% elif base_distro in ['debian', 'ubuntu'] %}
        {% set cyborg_api_packages = [
            'apache2',
            'libapache2-mod-wsgi'
        ] %}
    {% endif %}

{% endif %}

{{ macros.install_packages(cyborg_api_packages | customizable("packages")) }}

{% if base_distro in ['centos', 'oraclelinux', 'rhel'] %}
RUN sed -i -r 's,^(Listen 80),#\1,' /etc/httpd/conf/httpd.conf \
    && sed -i -r 's,^(Listen 443),#\1,' /etc/httpd/conf.d/ssl.conf

{% elif base_distro in ['debian', 'ubuntu'] %}
RUN echo > /etc/apache2/ports.conf

{% endif %}

COPY extend_start.sh /usr/local/bin/kolla_cyborg_extend_start
RUN chmod 755 /usr/local/bin/kolla_cyborg_extend_start

{% block cyborg_api_footer %}{% endblock %}
{% block footer %}{% endblock %}