23 Commits

Author SHA1 Message Date
blu
309663284b bump oi app version 2024-09-28 02:07:14 +02:00
blu
1b8efc107b update .env.sample 2024-09-12 12:02:23 +02:00
blu
a26d3ed655 add run_migrations command in abra.sh 2024-09-09 14:57:49 +02:00
blu
ded68a90d1 bump app version to 1.0.11 - for context, see this: coop-cloud/organising#638 2024-09-09 14:57:23 +02:00
blu
7d42e947b8 bump compose.yml app version to 0.0.11 - to not collide with the existing tag 2024-09-09 13:32:01 +02:00
blu
3707a5d16b bump version to 0.0.10 also in compose.yml 2024-09-09 13:24:41 +02:00
blu
ef51247ec9 Merge pull request 'bump open-inventory version from 0.0.9 to 0.0.10' (#3) from bumo-version-0.0.10 into main
(blu) Reviewed-on: #3
2024-09-09 09:42:24 +00:00
blu
c3b6828a3a bump open-inventory version from 0.0.9 to 0.0.10 2024-09-09 11:39:12 +02:00
blu
56e73c981b re-enable healtchecks 2024-03-18 18:39:05 +01:00
blu
bdb4f51d0b bump version 2024-03-18 16:40:44 +01:00
blu
ff5060783e update .env.sample 2024-03-18 14:34:20 +01:00
blu
10391ffcd3 one more fixup 2024-03-18 14:23:09 +01:00
blu
c18eaf48c8 error fixed: putting things together and cleanup 2024-03-18 14:09:12 +01:00
blu
b90d40b559 please work! 2024-03-18 13:23:38 +01:00
blu
8e807049d6 debug 2024-03-18 13:18:32 +01:00
blu
2e34b2f16a debug 2024-03-18 12:43:49 +01:00
blu
90ef71eaff fixing abra.sh 2024-03-18 10:57:51 +01:00
blu
e349736346 debugging error: FATA[0003] failed to create config open-inventory_example_com_entrypoint_conf_: Error response from daemon: rpc error: code = InvalidArgument desc = invalid name, only 64 [a-zA-Z0-9-_.] characters allowed, and the start and end character must be [a-zA-Z0-9] 2024-03-18 10:47:37 +01:00
blu
e748df9a70 fixing docker error 2024-03-15 18:26:22 +01:00
blu
892d37567a fix entrypoint template filepath 2024-03-15 18:13:21 +01:00
blu
1c1762581c fix docker image link in README 2024-03-15 17:40:17 +01:00
blu
125838948c fix entrypoint config 2024-03-15 17:39:42 +01:00
blu
d97a1c9e48 Merge pull request 'testing the workflow' (#2) from create-recipe-first-version into main
Reviewed-on: #2
2024-03-15 15:54:35 +00:00
5 changed files with 77 additions and 30 deletions

View File

@ -1,6 +1,11 @@
##### *START* - ESSENTIAL VALUES TO BE CONFIGURED
DOMAIN="open-inventory.example.net"
APP_URL="https://open-inventory.example.net"
# obtain an APP_KEY via `cat /dev/urandom | head -c 32 | base64`
APP_KEY="base64:yourGeneratedKeyHere"
##### *END* - ESSENTIAL VALUES TO BE CONFIGURED
TYPE=open-inventory
LETS_ENCRYPT_ENV=production
@ -9,7 +14,6 @@ DB_ROOT_PASSWORD_VERSION=1
APP_ENV=production
APP_NAME="Open Inventory"
APP_KEY=
APP_DEBUG=false
LOG_CHANNEL=stdout
@ -37,16 +41,21 @@ QUEUE_DRIVER=database
#MAIL_PASSWORD="SMTP Password"
#MAIL_ENCRYPTION=tls
COMPANY_NAME=""
COMPANY_REPRESENTATIVES=""
COMPANY_STREET=""
COMPANY_BUILDING=""
COMPANY_POSTALCODE=""
COMPANY_CITY=""
COMPANY_COUNTRY=""
COMPANY_TELEPHONE=""
COMPANY_EMAIL=""
INSTANCE_REPO="https://codeberg.org/eotl/open-inventory"
INSTANCE_NAME=""
INSTANCE_DESCRIPTION=""
INSTANCE_REPRESENTATIVES=""
INSTANCE_ADDRESS=""
INSTANCE_POSTALCODE=""
INSTANCE_CITY=""
INSTANCE_COUNTRY=""
INSTANCE_TELEPHONE=""
INSTANCE_EMAIL=""
EOTL_PATH_DATA="/home/eotl/data"
EOTL_URL_DISPATCH="http://localhost:8082"
EOTL_URL_SEXTANT="http://localhost:8081"
OSMR_NOMINATIM_URL=https://nominatim.openstreetmap.org/search.php
IDENTIFICATOR_URL=https://eotl.link
IDENTIFICATOR_USERNAME=
IDENTIFICATOR_PASSWORD=

View File

@ -5,7 +5,7 @@
<!-- metadata -->
* **Category**: Apps
* **Status**: 3, stable
* **Image**: [`open-inventory`](codeberg.org/eotl/open-inventory), 4, upstream
* **Image**: [`open-inventory`](https://codeberg.org/eotl/-/packages/container/open-inventory/), 4, upstream
* **Healthcheck**: Yes
* **Backups**: No
* **Email**: No

37
abra.sh
View File

@ -1,15 +1,29 @@
echo "### Entering abra.sh ..."
export ENTRYPOINT_CONF_VERSION=v1
export DB_PASSWORD=$(cat /run/secrets/db_password)
### Helpers
# these commands can be run via:
# abra app cmd open-inventory.example.net app $commandName
# where $commandName = {clear_cache, initial_setup, ...}
initial_setup() {
cd /app/
echo "Generating APP_KEY..."
php artisan key:generate
# clear config cache, where a previous invalid APP_KEY might still be present
clear_cache
run_migrations
create_first_admin_user
}
run_migrations() {
echo "DB migrations status:"
php artisan migrate:status
echo "Starting DB migrations..."
php artisan migrate
create_first_admin_user()
}
clear_cache() {
@ -38,3 +52,18 @@ create_first_admin_user() {
php artisan user:first "${ADMIN_NAME}" "${ADMIN_EMAIL}" "${ADMIN_PASSWORD}"
}
export_dot_env() {
env_file_path=$1
if [ ! -f "$env_file_path" ]; then
echo "Error: .env file not found at $env_file_path"
exit 1
fi
while IFS='=' read -r env_key env_value
do
export "$env_key=$env_value"
echo "Exported: $env_key"
done < "$env_file_path"
}

View File

@ -2,23 +2,25 @@ version: '3.8'
services:
app:
# Dockerfile here:
image: codeberg.org/eotl/open-inventory:0.0.8
entrypoint: ./entrypoint.sh
# Dockerfile here: https://codeberg.org/eotl/open-inventory/src/branch/main/docker/prod/Dockerfile
image: codeberg.org/eotl/open-inventory:latest
depends_on:
- db
networks:
- proxy
- internal
environment:
- DB_PASSWORD_FILE = /run/secrets/db_password
entrypoint: /abra-entrypoint.sh
configs:
- source: entrypoint_conf
target: /abra-entrypoint.sh
mode: 0555
secrets:
- db_password
healthcheck:
test: ["CMD", "curl", "-f", "http://127.0.0.1:8080/fpm-ping"]
interval: 30s
timeout: 10s
retries: 10
retries: 3
start_period: 1m
deploy:
update_config:
@ -30,9 +32,7 @@ services:
- "traefik.http.routers.${STACK_NAME}.rule=Host(`${DOMAIN}`)"
- "traefik.http.routers.${STACK_NAME}.entrypoints=web-secure"
- "traefik.http.routers.${STACK_NAME}.tls.certresolver=${LETS_ENCRYPT_ENV}"
- "coop-cloud.${STACK_NAME}.version=1.0.0+0.0.5"
- "coop-cloud.${STACK_NAME}.version=1.0.12"
db:
image: mariadb:10.5
init: true
@ -46,6 +46,12 @@ services:
secrets:
- db_password
- db_root_password
healthcheck:
test: ["CMD", "healthcheck.sh", "--su-mysql", "--connect", "--innodb_initialized"]
interval: 30s
timeout: 30s
retries: 3
start_period: 1m
deploy:
labels: [ 'coop-cloud.${STACK_NAME}.db.version=10.5-31e52f4d87a' ]
networks:
@ -67,3 +73,10 @@ secrets:
db_root_password:
external: true
name: ${STACK_NAME}_db_root_password_${DB_ROOT_PASSWORD_VERSION}
configs:
entrypoint_conf:
# FIXME: use ENTRYPOINT_CONF_VERSION, instead of hardcoded 'v1', ATM, it's failing when using the var
name: ${STACK_NAME}_entrypoint_conf_v1
file: entrypoint.sh.tmpl
template_driver: golang

View File

@ -3,10 +3,6 @@
# Laravel app (+ nginx) container
export DB_PASSWORD=$(cat /run/secrets/db_password)
# DB container
export MYSQL_PASSWORD=$(cat /run/secrets/db_password)
export MYSQL_ROOT_PASSWORD=$(cat /run/secrets/db_root_password)
# Upstream ENTRYPOINT
# https://codeberg.org/eotl/open-inventory/src/branch/main/docker/prod/Dockerfile
/app/docker/entrypoint.sh
/app/docker/prod/entrypoint.sh