Dockerfile.template 2.29 KB
Newer Older
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
# syntax=docker/dockerfile:1.10.0-labs
# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

{% include "templates/args.Dockerfile" %}

# --- Base Image Stages
{% if framework != "dynamo" %}
    {% include "templates/dynamo_base.Dockerfile" %}
    {% include "templates/wheel_builder.Dockerfile" %}
{% elif framework == "dynamo" %}
    {% if target == "frontend" %}
        {% include "templates/dynamo_base.Dockerfile" %}
        {% include "templates/wheel_builder.Dockerfile" %}
        {% include "templates/dynamo_runtime.Dockerfile" %}
        {% include "templates/frontend.Dockerfile" %}
    {% elif target == "runtime" or target == "dev" or target == "local-dev" %}
        {% include "templates/dynamo_base.Dockerfile" %}
        {% include "templates/wheel_builder.Dockerfile" %}
        {% include "templates/dynamo_runtime.Dockerfile" %}
    {% elif target == "wheel_builder" %}
        {% include "templates/dynamo_base.Dockerfile" %}
        {% include "templates/wheel_builder.Dockerfile" %}
    {% elif target == "base" %}
        {% include "templates/dynamo_base.Dockerfile" %}
    {% endif %}
{% endif %}

# --- Framework Stages
{% if framework == "sglang" %}
    # SGLang is the only framework without a `framework` target currently, needs special treatment
    {% include "templates/sglang_runtime.Dockerfile" %}
{% elif target == "framework" and framework != "dynamo" %}
    {% include "templates/" ~ framework ~ "_framework.Dockerfile" %}
{% elif ( target == "runtime" or target == "dev" or target == "local-dev" ) and framework != "dynamo" %}
    {% include "templates/" ~ framework ~ "_framework.Dockerfile" %}
    {% include "templates/" ~ framework ~ "_runtime.Dockerfile" %}
{% else %}
# --- No framework stages included
{% endif %}

{% if make_efa == true and target == "runtime" %}
    {% include "templates/aws.Dockerfile" %}
{% endif %}

# --- Development Stages
{% if target == "dev" or target == "local-dev" %}
    {% include "templates/dev.Dockerfile" %}
    {% if make_efa == true %}
        {% include "templates/aws.Dockerfile" %}
    {% endif %}
    {% if target == "local-dev" %}
        {% include "templates/local_dev.Dockerfile" %}
    {% endif %}
{% else %}
# --- No development stages included
{% endif %}