Add deployment pipeline, maintenance page and project config
- Makefile: install_dev, install_prod, migration/migrate commands - docker-compose-dev: add Caddy and Bun services - docker-compose-prod: remove exposed pgbouncer port - Ansible: Caddy template with maintenance mode (503), vault, deploy playbook - Gitea workflow: manual deploy to production - Maintenance page (Neubrutalism style) - LICENSE: proprietary license Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
17
.gitea/workflows/deploy.yml
Normal file
17
.gitea/workflows/deploy.yml
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
name: Deploy to production
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
deploy:
|
||||||
|
runs_on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install Ansible
|
||||||
|
run: apt-get update && apt-get install -y ansible
|
||||||
|
|
||||||
|
- name: Deploy Caddy config
|
||||||
|
run: ansible-playbook -i ansible/hosts.ini ansible/deploy-caddy.yml --vault-password-file <(echo "${{ secrets.ANSIBLE_VAULT_PASSWORD }}")
|
||||||
27
LICENSE.md
Normal file
27
LICENSE.md
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
# Licence Propriétaire
|
||||||
|
|
||||||
|
Copyright (c) 2026 E-Cosplay. Tous droits réservés.
|
||||||
|
|
||||||
|
## Conditions
|
||||||
|
|
||||||
|
Ce logiciel et son code source sont la propriété exclusive de E-Cosplay.
|
||||||
|
|
||||||
|
**Il est strictement interdit de :**
|
||||||
|
|
||||||
|
- Copier, reproduire ou dupliquer tout ou partie du code source
|
||||||
|
- Modifier, adapter ou créer des œuvres dérivées
|
||||||
|
- Distribuer, publier ou partager le code source sous quelque forme que ce soit
|
||||||
|
- Utiliser le code source à des fins commerciales ou non commerciales sans autorisation écrite
|
||||||
|
- Sous-licencier, vendre ou transférer le code source à des tiers
|
||||||
|
|
||||||
|
## Accès au code
|
||||||
|
|
||||||
|
L'accès au code source est strictement réservé aux membres autorisés de l'organisation E-Cosplay dans le cadre de leurs fonctions.
|
||||||
|
|
||||||
|
## Responsabilité
|
||||||
|
|
||||||
|
CE LOGICIEL EST FOURNI "EN L'ÉTAT", SANS GARANTIE D'AUCUNE SORTE, EXPRESSE OU IMPLICITE.
|
||||||
|
|
||||||
|
## Contact
|
||||||
|
|
||||||
|
Pour toute demande d'autorisation : contact@e-cosplay.fr
|
||||||
20
Makefile
20
Makefile
@@ -25,3 +25,23 @@ purge_dev: ## Arrete et purge les containers dev (volumes inclus)
|
|||||||
|
|
||||||
stop_prod: ## Arrete les containers prod
|
stop_prod: ## Arrete les containers prod
|
||||||
docker compose -f docker-compose-prod.yml down
|
docker compose -f docker-compose-prod.yml down
|
||||||
|
|
||||||
|
## —— Install ——————————————————————————————————————
|
||||||
|
install_dev: ## Install les dependances dev via Docker
|
||||||
|
docker compose -f docker-compose-dev.yml exec php composer install
|
||||||
|
docker compose -f docker-compose-dev.yml exec bun bun install
|
||||||
|
|
||||||
|
install_prod: ## Install les dependances et build les assets pour la prod
|
||||||
|
composer install --no-dev --optimize-autoloader
|
||||||
|
bun install
|
||||||
|
bun run build
|
||||||
|
|
||||||
|
## —— Database ——————————————————————————————————————
|
||||||
|
migration_dev: ## Genere une migration via Docker dev
|
||||||
|
docker compose -f docker-compose-dev.yml exec php php bin/console make:migration
|
||||||
|
|
||||||
|
migrate_dev: ## Execute les migrations via Docker dev
|
||||||
|
docker compose -f docker-compose-dev.yml exec php php bin/console doctrine:migrations:migrate --no-interaction
|
||||||
|
|
||||||
|
migrate_prod: ## Execute les migrations en prod via Docker
|
||||||
|
docker compose -f docker-compose-prod.yml exec php php bin/console doctrine:migrations:migrate --no-interaction --env=prod
|
||||||
|
|||||||
32
ansible/caddy.j2
Normal file
32
ansible/caddy.j2
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
ticket.e-cosplay.fr {
|
||||||
|
tls {
|
||||||
|
dns cloudflare {{ cloudflare_api_token }}
|
||||||
|
}
|
||||||
|
|
||||||
|
@maintenance file /var/www/e-ticket/public/.update
|
||||||
|
handle @maintenance {
|
||||||
|
root * /var/www/e-ticket/public
|
||||||
|
rewrite * /maintenance.html
|
||||||
|
file_server {
|
||||||
|
status 503
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
handle {
|
||||||
|
reverse_proxy localhost:9000 localhost:9001 {
|
||||||
|
lb_policy round_robin
|
||||||
|
health_uri /
|
||||||
|
health_interval 10s
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
encode gzip
|
||||||
|
|
||||||
|
header {
|
||||||
|
-Server
|
||||||
|
}
|
||||||
|
|
||||||
|
log {
|
||||||
|
output file /var/log/caddy/ticket.e-cosplay.fr.log
|
||||||
|
}
|
||||||
|
}
|
||||||
30
ansible/deploy-caddy.yml
Normal file
30
ansible/deploy-caddy.yml
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
---
|
||||||
|
- name: Deploy Caddy config for e-ticket
|
||||||
|
hosts: production
|
||||||
|
become: true
|
||||||
|
vars_files:
|
||||||
|
- vault.yml
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Ensure Caddy sites directory exists
|
||||||
|
file:
|
||||||
|
path: /etc/caddy/sites
|
||||||
|
state: directory
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: "0755"
|
||||||
|
|
||||||
|
- name: Deploy Caddy config
|
||||||
|
template:
|
||||||
|
src: caddy.j2
|
||||||
|
dest: /etc/caddy/sites/e-ticket.conf
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: "0644"
|
||||||
|
notify: Reload Caddy
|
||||||
|
|
||||||
|
handlers:
|
||||||
|
- name: Reload Caddy
|
||||||
|
systemd:
|
||||||
|
name: caddy
|
||||||
|
state: reloaded
|
||||||
8
ansible/vault.yml
Normal file
8
ansible/vault.yml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
$ANSIBLE_VAULT;1.1;AES256
|
||||||
|
34376230633964343735383363613430386439326535303762646264333330383166636539643439
|
||||||
|
3663303564386133313965343530383761353837626632390a323831366566356234626166646234
|
||||||
|
64316232613836376264363237346433393931623863653562656164346534663666373364626130
|
||||||
|
3833346535373064660a336234373730383438373233623231363335323162326666346136326162
|
||||||
|
65303265386365656164323838666239303639333534626264333962386631323531656262633363
|
||||||
|
64333734326466356236633061663933663962646165313935633361356339326366613731613765
|
||||||
|
383336626531663034666532636363306130
|
||||||
@@ -72,6 +72,17 @@ services:
|
|||||||
redis:
|
redis:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
|
||||||
|
bun:
|
||||||
|
image: oven/bun:alpine
|
||||||
|
container_name: e-ticket_bun
|
||||||
|
working_dir: /app
|
||||||
|
volumes:
|
||||||
|
- .:/app
|
||||||
|
- bun-modules:/app/node_modules
|
||||||
|
command: sh -c "bun install && bun run dev"
|
||||||
|
ports:
|
||||||
|
- "5173:5173"
|
||||||
|
|
||||||
mailpit:
|
mailpit:
|
||||||
image: axllent/mailpit
|
image: axllent/mailpit
|
||||||
container_name: e-ticket_mailpit
|
container_name: e-ticket_mailpit
|
||||||
@@ -91,3 +102,4 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
db-data:
|
db-data:
|
||||||
redis-data:
|
redis-data:
|
||||||
|
bun-modules:
|
||||||
|
|||||||
@@ -72,8 +72,6 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- ./docker/pgsql/pgbouncer.ini:/etc/pgbouncer/pgbouncer.ini
|
- ./docker/pgsql/pgbouncer.ini:/etc/pgbouncer/pgbouncer.ini
|
||||||
- ./docker/pgsql/userlist.txt:/etc/pgbouncer/userlist.txt
|
- ./docker/pgsql/userlist.txt:/etc/pgbouncer/userlist.txt
|
||||||
ports:
|
|
||||||
- "6432:6432"
|
|
||||||
depends_on:
|
depends_on:
|
||||||
db-master:
|
db-master:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
|||||||
93
public/maintenance.html
Normal file
93
public/maintenance.html
Normal file
@@ -0,0 +1,93 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="fr">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>Maintenance - E-Ticket</title>
|
||||||
|
<script src="https://cdn.tailwindcss.com"></script>
|
||||||
|
<style>
|
||||||
|
:root {
|
||||||
|
--fond: #fbfbfb;
|
||||||
|
--indigo: #4f46e5;
|
||||||
|
--jaune: #fabf04;
|
||||||
|
--rose: #ec4899;
|
||||||
|
--noir: #111827;
|
||||||
|
}
|
||||||
|
body {
|
||||||
|
background-color: var(--fond);
|
||||||
|
font-family: 'Inter', system-ui, sans-serif;
|
||||||
|
}
|
||||||
|
.shadow-brutal {
|
||||||
|
box-shadow: 8px 8px 0px rgba(0,0,0,1);
|
||||||
|
}
|
||||||
|
.shadow-brutal-sm {
|
||||||
|
box-shadow: 4px 4px 0px rgba(0,0,0,1);
|
||||||
|
}
|
||||||
|
@keyframes bounce-slow {
|
||||||
|
0%, 100% { transform: translateY(0); }
|
||||||
|
50% { transform: translateY(-10px); }
|
||||||
|
}
|
||||||
|
.animate-bounce-slow {
|
||||||
|
animation: bounce-slow 3s ease-in-out infinite;
|
||||||
|
}
|
||||||
|
@keyframes spin-slow {
|
||||||
|
from { transform: rotate(0deg); }
|
||||||
|
to { transform: rotate(360deg); }
|
||||||
|
}
|
||||||
|
.animate-spin-slow {
|
||||||
|
animation: spin-slow 4s linear infinite;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body class="min-h-screen flex items-center justify-center p-4">
|
||||||
|
<div class="max-w-xl w-full">
|
||||||
|
<!-- Logo -->
|
||||||
|
<div class="flex justify-center mb-8">
|
||||||
|
<div class="bg-white border-4 border-gray-900 rounded-2xl p-6 shadow-brutal">
|
||||||
|
<img src="/logo.png" alt="E-Cosplay" class="h-16">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Card principale -->
|
||||||
|
<div class="bg-white border-4 border-gray-900 rounded-2xl shadow-brutal overflow-hidden">
|
||||||
|
<!-- Header jaune -->
|
||||||
|
<div class="p-6 border-b-4 border-gray-900" style="background-color: var(--jaune);">
|
||||||
|
<div class="flex items-center justify-center gap-3">
|
||||||
|
<span class="text-4xl animate-bounce-slow">⚠</span>
|
||||||
|
<h1 class="text-2xl md:text-3xl font-black uppercase tracking-tight" style="color: var(--noir);">
|
||||||
|
Maintenance en cours
|
||||||
|
</h1>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Contenu -->
|
||||||
|
<div class="p-8 text-center">
|
||||||
|
<p class="text-lg font-bold uppercase mb-6" style="color: var(--noir);">
|
||||||
|
Notre site est en cours de mise a jour.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<div class="inline-flex items-center gap-3 border-4 border-gray-900 rounded-xl px-6 py-3 shadow-brutal-sm mb-6" style="background-color: var(--indigo);">
|
||||||
|
<svg class="w-5 h-5 text-white animate-spin-slow" fill="none" viewBox="0 0 24 24">
|
||||||
|
<circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
|
||||||
|
<path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"></path>
|
||||||
|
</svg>
|
||||||
|
<span class="text-white font-black uppercase text-sm tracking-widest">
|
||||||
|
Nous revenons tres vite
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p class="text-sm font-semibold" style="color: var(--noir);">
|
||||||
|
Merci de votre patience !
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Footer rose -->
|
||||||
|
<div class="p-4 border-t-4 border-gray-900 text-center" style="background-color: var(--rose);">
|
||||||
|
<p class="text-sm font-bold uppercase text-white tracking-wide">
|
||||||
|
contact@e-cosplay.fr
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Reference in New Issue
Block a user