forked from gothinkster/django-realworld-example-app
-
Notifications
You must be signed in to change notification settings - Fork 9
/
devfile.yaml
59 lines (54 loc) · 1.51 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
schemaVersion: 2.2.2
metadata:
name: python-django
components:
- name: tools
container:
image: quay.io/devfile/universal-developer-image:ubi8-latest
endpoints:
- exposure: public
name: django
targetPort: 7000
protocol: https
path: /api
volumeMounts:
- name: venv
path: /home/user/.venv
memoryLimit: 512Mi
mountSources: true
- name: venv
volume:
size: 1G
commands:
- id: install-dependencies
exec:
label: "Install dependencies"
component: tools
workingDir: ${PROJECT_SOURCE}
commandLine: "python3 -m venv .venv && . .venv/bin/activate && pip3 install -r requirements.txt && pip3 install ptvsd"
group:
kind: build
- id: migrate
exec:
label: "Migrate"
component: tools
workingDir: ${PROJECT_SOURCE}
commandLine: ". .venv/bin/activate && python3 manage.py migrate"
group:
kind: build
- id: run
exec:
label: "Run the server"
component: tools
workingDir: ${PROJECT_SOURCE}
commandLine: ". .venv/bin/activate && export DEBUG_MODE=False && python3 manage.py runserver 0.0.0.0:7000"
group:
kind: run
- id: debug
exec:
label: "Run the server in debug mode"
component: tools
workingDir: ${PROJECT_SOURCE}
commandLine: ". .venv/bin/activate && export DEBUG_MODE=True && python3 manage.py runserver 0.0.0.0:7000 --noreload --nothreading"
group:
kind: debug