-
Notifications
You must be signed in to change notification settings - Fork 91
/
devfile.yaml
89 lines (89 loc) · 2.53 KB
/
devfile.yaml
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
schemaVersion: 2.2.0
metadata:
name: python
displayName: Python
description: "Python (version 3.9.x) is an interpreted, object-oriented, high-level programming language with dynamic semantics.
Its high-level built in data structures, combined with dynamic typing and dynamic binding, make it very attractive for Rapid Application Development, as well as for use as a scripting or glue language to connect existing components together."
icon: https://raw.githubusercontent.com/devfile-samples/devfile-stack-icons/main/python.svg
tags:
- Python
- Pip
- Flask
projectType: Python
language: Python
provider: Red Hat
version: 3.0.0
starterProjects:
- name: flask-example
description:
'Flask is a web framework, it’s a Python module that lets you develop web applications easily.
It’s has a small and easy-to-extend core: it’s a microframework that doesn’t include an ORM (Object Relational Manager) or such features.'
git:
remotes:
origin: https://github.com/devfile-samples/python-ex
components:
- name: py
container:
image: registry.access.redhat.com/ubi9/python-39:1-1733173511
args: ['tail', '-f', '/dev/null']
mountSources: true
endpoints:
- name: http-python
targetPort: 8080
- exposure: none
name: debug
targetPort: 5858
env:
- name: DEBUG_PORT
value: '5858'
- name: build
image:
imageName: python-image:latest
dockerfile:
uri: docker/Dockerfile
buildContext: .
rootRequired: false
- name: deploy
kubernetes:
uri: kubernetes/deploy.yaml
endpoints:
- name: http-8081
targetPort: 8081
commands:
- id: pip-install-requirements
exec:
commandLine: pip install -r requirements.txt
workingDir: ${PROJECT_SOURCE}
group:
kind: build
isDefault: true
component: py
- id: run-app
exec:
commandLine: 'python app.py'
workingDir: ${PROJECT_SOURCE}
component: py
group:
kind: run
isDefault: true
- id: debug-py
exec:
commandLine: 'pip install debugpy && python -m debugpy --listen 0.0.0.0:${DEBUG_PORT} app.py'
workingDir: ${PROJECT_SOURCE}
component: py
group:
kind: debug
- id: build-image
apply:
component: build
- id: deployk8s
apply:
component: deploy
- id: deploy
composite:
commands:
- build-image
- deployk8s
group:
kind: deploy
isDefault: true