Skip to content

🚀 Mise à jour de la configuration Docker et du déploiement#3

Merged
BrightkyEfoo merged 16 commits into
developfrom
feat/continuous-deployment-dev
May 2, 2025
Merged

🚀 Mise à jour de la configuration Docker et du déploiement#3
BrightkyEfoo merged 16 commits into
developfrom
feat/continuous-deployment-dev

Conversation

@BrightkyEfoo
Copy link
Copy Markdown

Cette PR introduit une configuration complète pour la conteneurisation et le déploiement de l’application en environnement de développement.

🎯 Changements principaux

  • Ajout d’une architecture Docker multi-services :

    • Service app basé sur AdonisJS (Node.js 20.12.2)
    • Service mysql avec script d’initialisation
    • Service migrations pour l’exécution automatique des migrations
  • Nouveau fichier compose.yaml pour orchestrer les services via Docker Compose

  • Ajout d’un workflow GitHub Actions deploy.dev.yml permettant :

    • Le déploiement automatique sur un VPS à chaque push sur main
    • La génération dynamique du fichier .env
    • Le build et le redémarrage des conteneurs
  • Suppression de fichiers obsolètes :

    • Dockerfile.dev
    • compose.dev.yaml
    • Ancienne migration add_author_id_to_articles.ts (fusionnée dans la migration principale)
  • Mise à jour de .env.example avec les nouvelles variables nécessaires

  • Ajout de nouveaux patterns de fichiers à surveiller dans adonisrc.ts (notamment pour les images)

  • Nettoyage de la configuration du logger pour plus de clarté

🛠️ Objectifs

  • Faciliter le développement et la maintenance via une architecture conteneurisée claire
  • Assurer une configuration reproductible entre développement local et déploiement
  • Rendre le pipeline de CI/CD plus robuste et automatisé

- Add GitHub OAuth credentials to .env.example
- Introduce MySQL connection settings in .env.example
- Update logger configuration by removing unnecessary transport settings for improved clarity
- Exclude memory_bank/ directory from .gitignore
- Change NODE_ENV to ENV in the deployment workflow for consistency
- Add a step to create a .env file with necessary application and database configurations
- Update Docker compose commands to reference the new ENV variable
- Modify Docker Compose to use new environment variable names for database configuration
- Add initialization SQL script to the MySQL service in Docker Compose
- Update Dockerfile to use npm install with force for dependency installation
- Adjust deployment workflow to dynamically set database names in the .env file
- Remove outdated migration files related to articles
- Add new file watching patterns for images in adonisrc.ts
- Remove obsolete Dockerfile.dev and compose.dev.yaml files
- Update deployment workflow to reference the new compose.yaml
- Enhance active and progress documentation in memory bank to reflect current project state and architecture
- Delete the env.txt file as it is no longer needed in the project structure.
@BrightkyEfoo BrightkyEfoo changed the base branch from main to develop April 29, 2025 09:55
- Delete the deploy.dev.yml file as it is no longer needed in the project structure.
- Delete the deploy.yml file as it is no longer needed in the project structure.
- Add branch triggers for push and pull request events on main and develop branches in the deploy.dev.yml workflow.
- Add environment specification for the deployment job in the deploy.dev.yml workflow to ensure proper context during deployment.
- Modify the deployment workflow in deploy.dev.yml to change the application port from 3306 to 3333, ensuring proper application routing during deployment.
- Modify the deployment workflow in deploy.dev.yml to change the MySQL port from 3306 to 3307, ensuring compatibility with the updated database configuration.
- Modify the compose.yaml file to utilize environment variables for application and database configurations, enhancing flexibility and consistency across environments.
- Change NODE_ENV to production and update port configurations to use dynamic environment variables for both application and MySQL services.
…bles

- Change MySQL port configuration in compose.yaml to use MYSQL_PORT for improved flexibility.
- Update NODE_ENV to production and APP_KEY in deploy.dev.yml for consistency in the deployment environment.
- Change MySQL port configuration in compose.yaml from dynamic environment variable to a static value of 3306 for both production and development environments, ensuring consistency in database connectivity.
- Simplify the Docker Compose configuration by removing unnecessary volume mappings and ensuring the MySQL port is configurable via the new environment variable `${MYSQL_PORT}`.
- Update the Dockerfile to correctly copy the build artifacts and resources for production.
- Revise activeContext.md and productContext.md to reflect recent changes in the Docker setup and project objectives.
- Enhance projectbrief.md with detailed project goals and scope, emphasizing the use of Docker for consistent development and production environments.
- Correct the directory name in .gitignore from 'memory_bank/' to 'memory-bank/' for consistency.
- Simplify the Docker Compose configuration by removing unnecessary volume mappings.
- Adjust the Dockerfile to ensure proper copying of build artifacts and resources, including images for production deployment.
@BrightkyEfoo BrightkyEfoo merged commit c94f5ea into develop May 2, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant