wip: currently rewriting the project as a full stack application tangled.org/kacaii.dev/sigo
gleam

:technologist: allow to build image locally

+71 -55
+36
.docker-services/backend/compose.yaml
··· 1 + services: 2 + backend: 3 + container_name: senac-brigade-server 4 + image: kacaii/senac-brigade-server:latest 5 + profiles: ["prod"] 6 + restart: always 7 + 8 + depends_on: 9 + postgres: 10 + required: true 11 + condition: service_healthy 12 + 13 + environment: 14 + - DATABASE_URL 15 + - COOKIE_TOKEN 16 + - ADMIN_TOKEN 17 + ports: 18 + - 8000:8000 19 + 20 + backend-dev: 21 + container_name: senac-brigade-server-dev 22 + build: ../../. 23 + profiles: ["dev"] 24 + restart: always 25 + 26 + depends_on: 27 + postgres: 28 + required: true 29 + condition: service_healthy 30 + 31 + environment: 32 + - DATABASE_URL 33 + - COOKIE_TOKEN 34 + - ADMIN_TOKEN 35 + ports: 36 + - 8000:8000
+20
.docker-services/postgres/compose.yaml
··· 1 + services: 2 + postgres: 3 + container_name: postgres 4 + image: postgres:18-alpine 5 + profiles: ["dev", "prod"] 6 + restart: always 7 + healthcheck: 8 + test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"] 9 + interval: 5s 10 + timeout: 5s 11 + retries: 5 12 + volumes: 13 + - ../../priv/sql/create:/docker-entrypoint-initdb.d 14 + 15 + environment: 16 + - POSTGRES_USER 17 + - POSTGRES_PASSWORD 18 + - POSTGRES_DB 19 + ports: 20 + - 5432:5432
+11 -11
.justfiles/docker.just
··· 12 12 default: 13 13 just --list docker 14 14 15 + #  Start all containers: prod | dev 16 + compose-up enviroment: 17 + {{ docker }} compose --profile {{ enviroment }} up -d 18 + 19 + #  Stop all containers: prod | dev 20 + compose-down enviroment: 21 + {{ docker }} compose --profile {{ enviroment }} down 22 + 23 + #  Build, Tag and Push your app 24 + shipment: build-image tag-image push-image 25 + 15 26 #  Run the application container 16 27 run-application-container: 17 28 {{ docker }} run \ ··· 20 31 -e ADMIN_TOKEN={{ admin_token }} \ 21 32 -p 8000:8000 \ 22 33 {{ image_name }}:{{ tag_name }} 23 - 24 - #  Build, Tag and Push your app 25 - shipment: build-image tag-image push-image 26 - 27 - #  Start all containers 28 - compose-up: 29 - {{ docker }} compose up -d 30 - 31 - #  Stop all containers 32 - compose-down: 33 - {{ docker }} compose down 34 34 35 35 #  Build Docker image 36 36 [no-cd]
+3 -36
compose.yml
··· 1 - services: 2 - postgres: 3 - container_name: postgres 4 - image: postgres:18-alpine 5 - restart: always 6 - healthcheck: 7 - test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"] 8 - interval: 5s 9 - timeout: 5s 10 - retries: 5 11 - volumes: 12 - - ./priv/sql/create:/docker-entrypoint-initdb.d 13 - 14 - environment: 15 - - POSTGRES_USER 16 - - POSTGRES_PASSWORD 17 - - POSTGRES_DB 18 - ports: 19 - - 5432:5432 20 - 21 - backend: 22 - container_name: senac-brigade-server 23 - image: kacaii/senac-brigade-server:latest 24 - restart: always 25 - 26 - depends_on: 27 - postgres: 28 - required: true 29 - condition: service_healthy 30 - 31 - environment: 32 - - DATABASE_URL 33 - - COOKIE_TOKEN 34 - - ADMIN_TOKEN 35 - ports: 36 - - 8000:8000 1 + include: 2 + - .docker-services/postgres/compose.yaml 3 + - .docker-services/backend/compose.yaml
-7
justfile
··· 19 19 #  Rebuild the database empty 20 20 rebuild-empty: 21 21 just db::rebuild_empty 22 - 23 - up: 24 - just docker::compose-up 25 - 26 - down: 27 - just docker::compose-down 28 -
+1 -1
manifest.toml
··· 25 25 { name = "gleam_yielder", version = "1.1.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_yielder", source = "hex", outer_checksum = "8E4E4ECFA7982859F430C57F549200C7749823C106759F4A19A78AEA6687717A" }, 26 26 { name = "gleeunit", version = "1.9.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleeunit", source = "hex", outer_checksum = "DA9553CE58B67924B3C631F96FE3370C49EB6D6DC6B384EC4862CC4AAA718F3C" }, 27 27 { name = "glexer", version = "2.3.0", build_tools = ["gleam"], requirements = ["gleam_stdlib", "splitter"], otp_app = "glexer", source = "hex", outer_checksum = "40A1FB0919FA080AD6C5809B4C7DBA545841CAAC8168FACDFA0B0667C22475CC" }, 28 - { name = "glisten", version = "8.0.2", build_tools = ["gleam"], requirements = ["gleam_erlang", "gleam_otp", "gleam_stdlib", "logging", "telemetry"], otp_app = "glisten", source = "hex", outer_checksum = "CCFA4201B6D2077A68DA6E44200F1DDF9DFBC8EF5444A9E2A35B21C7BF801C1F" }, 28 + { name = "glisten", version = "8.0.3", build_tools = ["gleam"], requirements = ["gleam_erlang", "gleam_otp", "gleam_stdlib", "logging", "telemetry"], otp_app = "glisten", source = "hex", outer_checksum = "86B838196592D9EBDE7A1D2369AE3A51E568F7DD2D168706C463C42D17B95312" }, 29 29 { name = "global_value", version = "1.0.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "global_value", source = "hex", outer_checksum = "23F74C91A7B819C43ABCCBF49DAD5BB8799D81F2A3736BA9A534BD47F309FF4F" }, 30 30 { name = "gramps", version = "6.0.0", build_tools = ["gleam"], requirements = ["gleam_crypto", "gleam_erlang", "gleam_http", "gleam_stdlib"], otp_app = "gramps", source = "hex", outer_checksum = "8B7195978FBFD30B43DF791A8A272041B81E45D245314D7A41FC57237AA882A0" }, 31 31 { name = "group_registry", version = "1.0.0", build_tools = ["gleam"], requirements = ["gleam_erlang", "gleam_otp", "gleam_stdlib"], otp_app = "group_registry", source = "hex", outer_checksum = "BC798A53D6F2406DB94E27CB45C57052CB56B32ACF7CC16EA20F6BAEC7E36B90" },