tangled
alpha
login
or
join now
kacaii.dev
/
sigo
0
fork
atom
๐ฉโ๐ Firefighters API written in Gleam!
lustre
gleam
0
fork
atom
overview
issues
pulls
pipelines
:beer: go back to pods
kacaii.dev
1 week ago
44e4c799
b9ac4dfb
verified
This commit was signed with the committer's
known signature
.
kacaii.dev
SSH Key Fingerprint:
SHA256:n9v7QGNWHCUv1x/483hCtPUvTsVabU5PzC5CSJMUNtI=
+35
-34
2 changed files
expand all
collapse all
unified
split
compose.yml
justfile
-18
compose.yml
···
1
1
-
services:
2
2
-
postgres:
3
3
-
image: docker.io/postgres:18-alpine
4
4
-
container_name: postgres
5
5
-
restart: unless-stopped
6
6
-
ports:
7
7
-
- 5432:5432
8
8
-
volumes:
9
9
-
- "./sql/create:/docker-entrypoint-initdb.d"
10
10
-
environment:
11
11
-
- POSTGRES_USER
12
12
-
- POSTGRES_PASSWORD
13
13
-
- POSTGRES_DB
14
14
-
healthcheck:
15
15
-
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
16
16
-
interval: 5s
17
17
-
timeout: 5s
18
18
-
retries: 5
+35
-16
justfile
···
2
2
mod server
3
3
mod shared
4
4
5
5
+
pod_name := "pod_sigo"
6
6
+
7
7
+
pg_image := "docker.io/postgres:18-alpine"
8
8
+
pg_env := "-e POSTGRES_USER -e POSTGRES_PASSWORD -e POSTGRES_DB"
9
9
+
pg_port := "5432"
10
10
+
pg_volume := "-v ./sql/create:/docker-entrypoint-initdb.d"
11
11
+
12
12
+
pg_health_cmd := "--health-cmd 'pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}'"
13
13
+
pg_health_conf := "--health-interval 10s --health-retries 3 --health-timeout 5s"
14
14
+
pg_health_start_period := "--health-start-period 30s"
15
15
+
5
16
# List available recipes
6
17
@_default:
7
7
-
just --list
18
18
+
just --list
8
19
9
20
# Build Lustre runtime and start HTTP server
10
21
[group("dev")]
11
22
dev:
12
12
-
just client::build
13
13
-
just server::run
23
23
+
just client::build
24
24
+
just server::run
14
25
15
26
# Update project dependencies
16
27
[group("dev")]
17
28
deps-update:
18
18
-
just shared::deps-update
19
19
-
just client::deps-update
20
20
-
just server::deps-update
29
29
+
just shared::deps-update
30
30
+
just client::deps-update
31
31
+
just server::deps-update
21
32
22
33
# Check for errors
23
34
[group("dev")]
24
35
lint:
25
25
-
just server::lint
26
26
-
just client::lint
27
27
-
just shared::lint
36
36
+
just server::lint
37
37
+
just client::lint
38
38
+
just shared::lint
28
39
29
40
# Run unit tests
30
41
[group("dev")]
31
42
test:
32
32
-
just server::test
43
43
+
just server::test
44
44
+
45
45
+
# Clean pod resources
46
46
+
[group("podman")]
47
47
+
clean:
48
48
+
podman pod rm -f {{ pod_name }}
33
49
34
34
-
[group("pod")]
35
35
-
compose-up:
36
36
-
podman-compose up -d
50
50
+
# Init the database container
51
51
+
[group("podman")]
52
52
+
@init-database: create-pod
53
53
+
podman run --rm -d --name postgres-database --pod {{ pod_name }} --replace {{ pg_env }} \
54
54
+
{{ pg_health_cmd }} {{ pg_health_conf }} {{ pg_health_start_period }} \
55
55
+
{{ pg_volume }} {{ pg_image }}
37
56
38
38
-
[group("pod")]
39
39
-
compose-down:
40
40
-
podman-compose down -v
57
57
+
[private]
58
58
+
@create-pod:
59
59
+
podman pod create --name {{ pod_name }} --replace -p {{ pg_port }}:5432