-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdevspace.yaml
More file actions
executable file
·150 lines (138 loc) · 4.27 KB
/
devspace.yaml
File metadata and controls
executable file
·150 lines (138 loc) · 4.27 KB
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
version: v2beta1
name: devspace-flask
# load vars from .env
vars:
DATABASE_IMAGE: "database"
DEVSPACE_ENV_FILE: ".env"
# This is a list of `pipelines` that DevSpace can execute (you can define your own)
pipelines:
# This is the pipeline for the main command: `devspace dev` (or `devspace run-pipeline dev`)
dev:
run: |-
run_dependencies --all
create_deployments --all
start_dev --all
# You can run this pipeline via `devspace deploy` (or `devspace run-pipeline deploy`)
deploy:
run: |-
run_dependencies --all
build_images --all -t $(git describe --always)
create_deployments --all
# This is a list of `images` that DevSpace can build for this project
# We recommend to skip image building during development (devspace dev) as much as possible
images:
app1:
image: my-app
context: ./backend/app1/
dockerfile: ./backend/app1/Dockerfile
app2:
image: my-app2
context: ./backend/app2/
dockerfile: ./backend/app2/Dockerfile
database:
image: jaydockship/database
context: ./database
dockerfile: ./database/Dockerfile
# This is a list of `deployments` that DevSpace can create for this project
deployments:
my-deployment:
# This deployment uses `kubectl` but you can also define `helm` deployments
kubectl:
manifests:
- ./kube/kustomization
kustomize: true
# This is a list of `dev` containers that are based on the containers created by your deployments
dev:
app1:
# Search for the container that runs this image
labelSelector:
app: app1
containers:
app1:
# Replace the container image with this dev-optimized image (allows to skip image building during development)
devImage: ${DOCKER_REPO}/base-app-dev:0.0.2
workingDir: /src
command: ["python", "main.py"]
sync:
- path: ./backend/app1:/src
onUpload:
restartContainer: true
logs: {}
# Open a terminal and use the following command to start it
# terminal:
# command: ./devspace_start.sh
# Inject a lightweight SSH server into the container (so your IDE can connect to the remote dev env)
ssh:
enabled: true
# Make the following commands from my local machine available inside the dev container
proxyCommands:
- command: devspace
- command: kubectl
- command: helm
- command: git
# Forward the following ports to be able access your application via localhost
ports:
- port: "8080"
# Open the following URLs once they return an HTTP status code other than 502 or 503
open:
- url: http://localhost:8080
app2:
labelSelector:
app: app2
containers:
app2:
devImage: ${DOCKER_REPO}/base-app-dev:0.0.2
workingDir: /src
command: ["python", "main.py"]
sync:
- path: ./backend/app2:/src
onUpload:
restartContainer: true
logs: {}
ssh:
enabled: true
proxyCommands:
- command: devspace
- command: kubectl
- command: helm
- command: git
ports:
- port: "8000"
open:
- url: http://localhost:8000
frontend:
labelSelector:
app: spa-frontend
restartHelper:
inject: true
devImage: ${DOCKER_REPO}/spa-dev:1.0.0
command: ["npm", "run", "start"]
logs: {}
ports:
- port: "4200"
open:
- url: http://localhost:4200
sync:
- path: ./frontend/spa:/app/
disableDownload: true
startContainer: true
excludePaths:
- node_modules/
- build/
- .npm/
onUpload:
exec:
- command: |-
npm ci --cache .npm --prefer-offline
## Important- only restart the container, not the main process
/tmp/devspacehelper restart
onChange: ["./package.json"]
# Use the `commands` section to define repeatable dev workflows for this project
commands:
# build base dev docker image
bdi-app:
command: |-
docker build -t ${DOCKER_REPO}/base-app-dev:0.0.2 -f ./backend/Dockerfile.dev ./backend
bdi-db:
command: |-
docker build -t ${DOCKER_REPO}/database -f ./database/Dockerfile ./database