Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add turborepo and Docker config #24

Merged
merged 2 commits into from
Nov 14, 2024
Merged

feat: Add turborepo and Docker config #24

merged 2 commits into from
Nov 14, 2024

Conversation

HugoRCD
Copy link
Owner

@HugoRCD HugoRCD commented Nov 14, 2024

This pull request includes several changes to automate the build and deployment process using Docker and Turbo, as well as updates to configuration files and scripts. The most important changes include the addition of a GitHub Actions workflow for building and pushing Docker images, the creation of a multi-stage Dockerfile, and updates to the build and development scripts.

Automation and CI/CD:

  • Added a GitHub Actions workflow to build and push Docker images on push to the main branch or when a new tag is created. This workflow includes steps to check for changes, set up Docker, and build and push the Docker image. (.github/workflows/build-app-image.yml)

Docker and Environment Configuration:

  • Created a multi-stage Dockerfile for the currencia application, which includes a build stage using the oven/bun image and a final stage for running the application. (apps/currencia/Dockerfile)
  • Added an example environment file for Docker to specify the NUXT_PUBLIC_SITE_URL variable. (docker/.env.example)
  • Added a Docker Compose configuration for local development, including services for the currencia application and a PostgreSQL database. (docker/docker-compose.local.yml)

Build and Development Scripts:

  • Updated the package.json scripts to use Turbo for various tasks such as development, building, linting, and testing. (package.json)
  • Added a turbo.json configuration file to define global dependencies and task configurations for Turbo. (turbo.json)

Configuration Updates:

  • Updated the Nuxt configuration to set the Nitro preset based on an environment variable. (apps/currencia/nuxt.config.ts)

Add Docker support and switch to TurboRepo

This update introduces Docker support for the Currencia application. A new Dockerfile has been added, along with docker-compose configuration for local development. The build process now uses two stages: a build stage and a final stage.

The project's package.json scripts have been updated to use TurboRepo commands instead of bun, reflecting a shift in the build tooling. This includes changes to dev, lint, and other script commands.

A turbo.json file was also introduced to manage tasks related to building, generating, developing, and testing the application using TurboRepo.

Lastly, an example .env file was added for setting up environment variables in Docker.
Introduced a new GitHub Actions workflow to automatically build and push Docker images for the application. The workflow triggers on pushes to main branch, tag creation, or manual dispatch. It checks for changes in specific paths before proceeding with the build.

Updated .gitignore to ignore .turbo files.

Modified Dockerfile of the currencia app to include DATABASE_URL as an argument and environment variable. Also adjusted the build steps and added installation of curl.

Adjusted nuxt.config.ts file to allow setting NITRO_PRESET from environment variables.

Updated docker-compose.local.yml file to include database service configuration for local development.

Added a new script "build:app" in package.json for building only the currencia app.
@HugoRCD HugoRCD self-assigned this Nov 14, 2024
Copy link

vercel bot commented Nov 14, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
currencia ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 14, 2024 0:57am

Copy link

gitguardian bot commented Nov 14, 2024

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secret in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
14476214 Triggered Generic Password d0839b2 docker/docker-compose.local.yml View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

Copy link

github-actions bot commented Nov 14, 2024

Thank you for following the naming conventions! 🙏

@HugoRCD HugoRCD changed the title Epi 65 feat: Add turborepo and Docker config Nov 14, 2024
@HugoRCD HugoRCD merged commit 7560b43 into main Nov 14, 2024
4 of 8 checks passed
@HugoRCD HugoRCD deleted the epi-65 branch November 14, 2024 12:56
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