Run multiple services inside a docker container
Project description
multi-start
This tool aims to help running multiple services inside a single docker container.
Sometimes you might want to have backend, frontend and nginx (or a combination of those) inside a single container. This tool may help with:
- Prepare final Nginx configs using parse-template
- Wait until backend and frontend start responding before running Nginx
- Stop every process if one of them exits so the whole container stops gracefully
Installation
pip install multi-start
Usage
multi-start --help
Usage: multi-start [OPTIONS]
Run multiple services at once. Set DEBUG environment variable to 1 for more
verbose output when running.
Options:
--backend / --no-backend Enable backend service [default: no-
backend]
--backend-cmd TEXT Command to start backend service [default:
poetry run invoke serve]
--backend-dir TEXT Working directory for the backend [default:
backend]
--backend-port INTEGER Port number that backend is running at if
port is used
--backend-socket TEXT UNIX socket path that backend is running at
if socket is used [default:
/run/nginx/uvicorn.sock]
--frontend / --no-frontend Enable frontend service [default: no-
frontend]
--frontend-port INTEGER Port number that frontend is running at
[default: 3000]
--frontend-cmd TEXT Command to start frontend service [default:
pnpm run start]
--frontend-dir TEXT Working directory for the frontend
[default: frontend]
--nginx / --no-nginx Enable nginx [default: no-nginx]
--nginx-cmd TEXT Command to start Nginx [default: nginx -g
"daemon off;"]
--service-wait-time FLOAT How long to wait for a service to be up an
running (sec) [default: 3.0]
Development
Make sure you install pre-commit and run:
pre-commit install
For testing you can use e.g.
poetry run multi-start \
--backend \
--backend-dir ../another-project/src \
--backend-cmd "poetry run invoke dev" \
--backend-port 8080
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
multi_start-1.0.1.tar.gz
(5.6 kB
view hashes)
Built Distribution
Close
Hashes for multi_start-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1befbc3a6ef6774a201b580b126411fa37af4d51fd04873389863887ba4fa7df |
|
MD5 | 854815df824f55a221cab6557a853729 |
|
BLAKE2b-256 | d49506b06e7d693dfc34e0ba009671c34c370865e757b8666ef51a42b5bd4d41 |