Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3cf9db8829 | ||
|
|
12c2b1e1b3 | ||
|
|
b92c09cf55 | ||
| 18cb9d5d80 |
@@ -2,10 +2,10 @@
|
|||||||
.gitea
|
.gitea
|
||||||
.env.local
|
.env.local
|
||||||
.env.test
|
.env.test
|
||||||
docker/
|
infra/dev/
|
||||||
deploy/docker/docker-compose.prod.yml
|
infra/prod/docker-compose.yml
|
||||||
deploy/docker/deploy.sh
|
infra/prod/deploy.sh
|
||||||
deploy/docker/.env.example
|
infra/prod/.env.example
|
||||||
frontend/node_modules
|
frontend/node_modules
|
||||||
frontend/.nuxt
|
frontend/.nuxt
|
||||||
frontend/.output
|
frontend/.output
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ jobs:
|
|||||||
- name: Build Docker image
|
- name: Build Docker image
|
||||||
run: |
|
run: |
|
||||||
docker build \
|
docker build \
|
||||||
-f deploy/docker/Dockerfile.prod \
|
-f infra/prod/Dockerfile \
|
||||||
-t gitea.malio.fr/malio-dev/inventory:${{ gitea.ref_name }} \
|
-t gitea.malio.fr/malio-dev/inventory:${{ gitea.ref_name }} \
|
||||||
-t gitea.malio.fr/malio-dev/inventory:latest \
|
-t gitea.malio.fr/malio-dev/inventory:latest \
|
||||||
.
|
.
|
||||||
|
|||||||
@@ -1,67 +0,0 @@
|
|||||||
name: Build Release Artefact
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
tags:
|
|
||||||
- "v*"
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
persist-credentials: false
|
|
||||||
|
|
||||||
- name: Setup PHP
|
|
||||||
uses: shivammathur/setup-php@v2
|
|
||||||
with:
|
|
||||||
php-version: "8.4"
|
|
||||||
extensions: mbstring, intl, pdo_pgsql, xml, curl, zip, gd
|
|
||||||
|
|
||||||
- name: Setup Node
|
|
||||||
uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: "lts/*"
|
|
||||||
|
|
||||||
- name: Install backend deps (prod)
|
|
||||||
env:
|
|
||||||
APP_ENV: prod
|
|
||||||
APP_DEBUG: "0"
|
|
||||||
run: composer install --no-dev --optimize-autoloader --no-interaction --no-scripts
|
|
||||||
|
|
||||||
- name: Build frontend (static)
|
|
||||||
run: |
|
|
||||||
cd frontend
|
|
||||||
npm ci
|
|
||||||
CI=1 NUXT_TELEMETRY_DISABLED=1 NUXT_PUBLIC_API_BASE_URL=/api NUXT_PUBLIC_APP_BASE=/ npm run generate
|
|
||||||
test -f .output/public/index.html
|
|
||||||
|
|
||||||
- name: Build artefact
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
set -euo pipefail
|
|
||||||
mkdir -p release
|
|
||||||
tar -czf "release/inventory-${GITHUB_REF_NAME}.tar.gz" \
|
|
||||||
.env \
|
|
||||||
bin \
|
|
||||||
config \
|
|
||||||
migrations \
|
|
||||||
public \
|
|
||||||
src \
|
|
||||||
templates \
|
|
||||||
vendor \
|
|
||||||
composer.json \
|
|
||||||
composer.lock \
|
|
||||||
symfony.lock \
|
|
||||||
VERSION \
|
|
||||||
frontend/.output
|
|
||||||
|
|
||||||
- name: Create Release
|
|
||||||
uses: softprops/action-gh-release@v2
|
|
||||||
with:
|
|
||||||
files: release/inventory-${{ github.ref_name }}.tar.gz
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
|
|
||||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -20,7 +20,7 @@
|
|||||||
###< phpunit/phpunit ###
|
###< phpunit/phpunit ###
|
||||||
|
|
||||||
###> docker ###
|
###> docker ###
|
||||||
docker/.env.docker.local
|
infra/dev/.env.docker.local
|
||||||
###< docker ###
|
###< docker ###
|
||||||
###> migration archives ###
|
###> migration archives ###
|
||||||
/_archives/
|
/_archives/
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ make start
|
|||||||
make install
|
make install
|
||||||
```
|
```
|
||||||
|
|
||||||
> Si `make start` échoue sur le port de la BDD, modifier `POSTGRES_PORT` dans `docker/.env.docker.local`.
|
> Si `make start` échoue sur le port de la BDD, modifier `POSTGRES_PORT` dans `infra/dev/.env.docker.local`.
|
||||||
|
|
||||||
### Que fait `make install` ?
|
### Que fait `make install` ?
|
||||||
|
|
||||||
@@ -254,7 +254,7 @@ Configuration PhpStorm / VSCode :
|
|||||||
- **Port** : `8081`
|
- **Port** : `8081`
|
||||||
- **Path mapping** : racine du projet → `/var/www/html`
|
- **Path mapping** : racine du projet → `/var/www/html`
|
||||||
|
|
||||||
> Sous WSL, modifier `XDEBUG_CLIENT_HOST` dans `docker/.env.docker.local` avec votre IP locale.
|
> Sous WSL, modifier `XDEBUG_CLIENT_HOST` dans `infra/dev/.env.docker.local` avec votre IP locale.
|
||||||
|
|
||||||
## Git
|
## Git
|
||||||
|
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
parameters:
|
parameters:
|
||||||
app.version: '1.9.9'
|
app.version: '1.9.11'
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ services:
|
|||||||
web:
|
web:
|
||||||
container_name: php-${DOCKER_APP_NAME}-apache
|
container_name: php-${DOCKER_APP_NAME}-apache
|
||||||
build:
|
build:
|
||||||
context: ./docker/php
|
context: ./infra/dev
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
args:
|
args:
|
||||||
DOCKER_PHP_VERSION: ${DOCKER_PHP_VERSION}
|
DOCKER_PHP_VERSION: ${DOCKER_PHP_VERSION}
|
||||||
@@ -20,9 +20,9 @@ services:
|
|||||||
- ~/.cache:/var/www/.cache # Pour la cache de composer
|
- ~/.cache:/var/www/.cache # Pour la cache de composer
|
||||||
- ~/.config:/var/www/.config # Pour la config de yarn
|
- ~/.config:/var/www/.config # Pour la config de yarn
|
||||||
- ~/.composer:/var/www/.composer # Pour la config de composer
|
- ~/.composer:/var/www/.composer # Pour la config de composer
|
||||||
- ./docker/php/config/php.ini:/usr/local/etc/php/php.ini
|
- ./infra/dev/php.ini:/usr/local/etc/php/php.ini
|
||||||
- ./docker/php/config/vhost.conf:/etc/apache2/sites-available/000-default.conf
|
- ./infra/dev/vhost.conf:/etc/apache2/sites-available/000-default.conf
|
||||||
- ./docker/php/config/docker-php-ext-xdebug.ini:/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
|
- ./infra/dev/xdebug.ini:/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
|
||||||
- ./LOG:/var/www/html/LOG
|
- ./LOG:/var/www/html/LOG
|
||||||
- ./LOG/logs_apache:/var/log/apache2/
|
- ./LOG/logs_apache:/var/log/apache2/
|
||||||
extra_hosts:
|
extra_hosts:
|
||||||
|
|||||||
@@ -61,8 +61,8 @@ RUN ln -sf /dev/stdout /var/log/nginx/access.log \
|
|||||||
RUN rm -f /etc/nginx/sites-enabled/default
|
RUN rm -f /etc/nginx/sites-enabled/default
|
||||||
|
|
||||||
# Configs
|
# Configs
|
||||||
COPY deploy/docker/supervisord.conf /etc/supervisor/conf.d/app.conf
|
COPY infra/prod/supervisord.conf /etc/supervisor/conf.d/app.conf
|
||||||
COPY deploy/docker/nginx.conf /etc/nginx/sites-enabled/inventory.conf
|
COPY infra/prod/nginx.conf /etc/nginx/sites-enabled/inventory.conf
|
||||||
|
|
||||||
# Backend from stage 1
|
# Backend from stage 1
|
||||||
COPY --from=backend-build /app /var/www/html
|
COPY --from=backend-build /app /var/www/html
|
||||||
8
makefile
8
makefile
@@ -1,6 +1,6 @@
|
|||||||
# Permet d'utiliser un .env.docker.local pour override
|
# Permet d'utiliser un .env.docker.local pour override
|
||||||
ENV_DEFAULT = docker/.env.docker
|
ENV_DEFAULT = infra/dev/.env.docker
|
||||||
ENV_LOCAL = docker/.env.docker.local
|
ENV_LOCAL = infra/dev/.env.docker.local
|
||||||
ENV_FILE := $(if $(wildcard $(ENV_LOCAL)),$(ENV_LOCAL),$(ENV_DEFAULT))
|
ENV_FILE := $(if $(wildcard $(ENV_LOCAL)),$(ENV_LOCAL),$(ENV_DEFAULT))
|
||||||
|
|
||||||
# Permet d'avoir les variables du fichier .env.docker.local
|
# Permet d'avoir les variables du fichier .env.docker.local
|
||||||
@@ -25,13 +25,13 @@ DATA_SQL_NORM ?= data_norm.sql
|
|||||||
#========================================================================================
|
#========================================================================================
|
||||||
|
|
||||||
env-init:
|
env-init:
|
||||||
@mkdir -p docker
|
@mkdir -p infra/dev
|
||||||
@cp --update=none $(ENV_DEFAULT) $(ENV_LOCAL)
|
@cp --update=none $(ENV_DEFAULT) $(ENV_LOCAL)
|
||||||
|
|
||||||
# Lance le container
|
# Lance le container
|
||||||
start: env-init
|
start: env-init
|
||||||
@echo "**** START CONTAINERS ****"
|
@echo "**** START CONTAINERS ****"
|
||||||
@cp --update=none docker/.env.docker docker/.env.docker.local
|
@cp --update=none infra/dev/.env.docker infra/dev/.env.docker.local
|
||||||
CURRENT_UID=$(shell id -u) CURRENT_GID=$(shell id -g) $(DOCKER_COMPOSE) up -d
|
CURRENT_UID=$(shell id -u) CURRENT_GID=$(shell id -g) $(DOCKER_COMPOSE) up -d
|
||||||
@echo ""
|
@echo ""
|
||||||
@echo "URLs disponibles:"
|
@echo "URLs disponibles:"
|
||||||
|
|||||||
Reference in New Issue
Block a user