Skip to content

Commit bc5ef0a

Browse files
feat: process-compose
1 parent 93867c7 commit bc5ef0a

File tree

5 files changed

+75
-1
lines changed

5 files changed

+75
-1
lines changed

.pc_env

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# https://f1bonacc1.github.io/process-compose/configuration/
2+
3+
# disable tui (default: 1)
4+
PC_DISABLE_TUI=1
5+
6+
# set port (default: 8080)
7+
PC_PORT_NUM=10000
8+
9+
# disable server (default: 1)
10+
# PC_NO_SERVER=1

.tool-versions

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
python 3.11.9
21
poetry 1.8.3
2+
process-compose 1.24.2
3+
python 3.11.9
34
uv 0.2.5

process-compose.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
version: "0.5"
2+
3+
log_location: /tmp/process-compose.log
4+
log_level: info # trace / debug / info / warn / error / fatal / panic
5+
log_configuration:
6+
rotation:
7+
max_size_mb: 1 # size in MB of the logfile before it's rolled
8+
max_age_days: 5 # age in days to keep a logfile
9+
max_backups: 3 # number of rolled files to keep
10+
compress: true
11+
12+
is_strict: true
13+
14+
disable_env_expansion: true
15+
16+
processes:
17+
redis:
18+
command: >
19+
docker run --rm -d \
20+
--name "${NAME:-devbox-redis}" \
21+
-p "${PORT:-6379}:6379" \
22+
"redis:${VERSION:-6.2}-alpine"
23+
is_daemon: true
24+
environment: null
25+
readiness_probe:
26+
exec:
27+
command: >
28+
timeout 12s bash -c \
29+
"until echo PING \
30+
| nc -z localhost ${PORT:-6379} \
31+
; do sleep 1 \
32+
; done"
33+
availability:
34+
exit_on_end: true
35+
is_tty: false
36+
shutdown:
37+
command: "docker stop ${NAME:-devbox-redis}"
38+
timeout_seconds: 10 # default: 10
39+
signal: 15 # default: 15

taskfile.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ includes:
1616
taskfile: ./taskfiles/docker.yml
1717
poetry:
1818
taskfile: ./taskfiles/poetry.yml
19+
redis:
20+
taskfile: ./taskfiles/redis.yml
1921

2022
tasks:
2123
default:

taskfiles/redis.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
version: "3.0"
2+
3+
set: ['e', 'u', 'pipefail']
4+
shopt: ['globstar']
5+
6+
env:
7+
NAME: dev-redis
8+
PORT: 6379
9+
VERSION: 6.2
10+
11+
tasks:
12+
start:
13+
desc: "Start Redis server"
14+
cmds:
15+
- process-compose up -D redis 2>&1 > /dev/null
16+
silent: true
17+
18+
stop:
19+
desc: "Stop Redis server"
20+
cmds:
21+
- process-compose down
22+
silent: true

0 commit comments

Comments
 (0)