Compare commits
24 Commits
create-rec
...
v1.0.13
| Author | SHA1 | Date | |
|---|---|---|---|
|
6cfdb507cd
|
|||
|
309663284b
|
|||
|
1b8efc107b
|
|||
|
a26d3ed655
|
|||
|
ded68a90d1
|
|||
|
7d42e947b8
|
|||
|
3707a5d16b
|
|||
| ef51247ec9 | |||
|
c3b6828a3a
|
|||
|
56e73c981b
|
|||
|
bdb4f51d0b
|
|||
|
ff5060783e
|
|||
|
10391ffcd3
|
|||
|
c18eaf48c8
|
|||
|
b90d40b559
|
|||
|
8e807049d6
|
|||
|
2e34b2f16a
|
|||
|
90ef71eaff
|
|||
|
e349736346
|
|||
|
e748df9a70
|
|||
|
892d37567a
|
|||
|
1c1762581c
|
|||
|
125838948c
|
|||
| d97a1c9e48 |
31
.env.sample
31
.env.sample
@ -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=
|
||||
|
||||
@ -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
37
abra.sh
@ -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"
|
||||
}
|
||||
|
||||
31
compose.yml
31
compose.yml
@ -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:0.0.11
|
||||
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
|
||||
|
||||
@ -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
|
||||
Reference in New Issue
Block a user