Starting multiple terminals on start up of dev containers #9180
Replies: 3 comments
-
I want the same thing. I have a Wordpress plugin with a docker-compose that spins up a DB and Wordpress. The plugin has a public JS part and an admin JS part in two separate folders with a package.json, webpack.conf.js files and such each.
This was easy to do in gitpod; tasks:
- name: Docker Compose
init: docker-compose pull
command: docker-compose up
- name: Public JS
before: cd public
command: |
npm i
npm run dev
- name: Admin JS
before: cd admin
command: |
npm i
npm run dev |
Beta Was this translation helpful? Give feedback.
-
this feature is very important to make painless starting environment after shutdown or restart of workspace, otherwise it requires to start many tasks again and again |
Beta Was this translation helpful? Give feedback.
-
It seems like a |
Beta Was this translation helpful? Give feedback.
-
Hello, I'm looking at creating a
devcontainer.json
definition for a mono repo, where there will be a couple of backend projects and a frontend project. One thing I would like to do is when the dev container starts it opens up a terminal for each of the projects (perhaps with a name for each terminal) and physically starts the codebase for each of the projects in the mono repo. This will mean as soon as somebody opens up the mono repo in a dev container they will have the entire codebase running.Lets take an example just to illustrate this further. Imagine we have a mono repo called
test
in git, which had the following sub foldersserviceA
- (a nodeJS express application)serviceB
- (a nodeJS express application)frontend
- (a react application)I would like it that when the dev container starts up it would start 3 terminals
serviceA
which is runningserviceA
perhaps with something likenpm start
serviceB
frontend
which is runningfrontend
perhaps with something likenpm start
I couldn't quite find a way to do this in the reference (https://code.visualstudio.com/docs/remote/devcontainerjson-reference), however it does seem like something that can be done in Gitpod with "tasks".
Thank you for any feedback/information.
Beta Was this translation helpful? Give feedback.
All reactions