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

chore: setup prod and dev docker with compose #236

Merged
merged 1 commit into from
Jun 21, 2024
Merged

Conversation

ygrishajev
Copy link
Contributor

@ygrishajev ygrishajev commented Jun 11, 2024

This PR introduces several enhancements to the Docker setup:

  • Staged Builds in Dockerfiles: Ensures all Dockerfiles use multi-stage builds, allowing services to be built for both development and production using the same file.
  • Alpine-Based Images: Standardizes all images to use Alpine as the base image to reduce the overall size.
  • Compose Files for Different Environments:
    • Build: Adds a Docker Compose file for building the images to verify they won't break in CI.
    • Production: Adds a Docker Compose file for running services in production mode to ensure they won't break once deployed.
    • Development: Adds a Docker Compose file for development mode, including hot-reload and other development tools.
  • Root Package.json Updates: Adds relevant commands to the root package.json to improve the developer experience (DX).

With these changes, we can ensure that any developer can test and run the project in any environment, whether it's for development, continuous integration, or production, providing a consistent and reliable setup across all stages.

@baktun14
Copy link
Contributor

We need to test actually deploying in prod with this config

@ygrishajev ygrishajev force-pushed the feature/compose branch 3 times, most recently from 82e54ff to f00c727 Compare June 13, 2024 13:24
@ygrishajev
Copy link
Contributor Author

After some thinking I removed the dep on .env.local for some services in docker compose file. Added a .env.sandbox.docker-compose-dev to git having all that's needed for staging

@ygrishajev ygrishajev requested a review from Redm4x June 13, 2024 13:26
docker/Dockerfile.stats-web Outdated Show resolved Hide resolved
@ygrishajev
Copy link
Contributor Author

@baktun14 @baktun14 improved this further today:

  • ensured all apps are build the same way and this allowed to use same docker files for apps with the same stack: nodejs and nextjs
  • added health checks to so that apps wait to start till migration is done
  • ensured apps are served in non-privileged mode for security implications

@ygrishajev ygrishajev requested a review from Redm4x June 17, 2024 11:35
@ygrishajev
Copy link
Contributor Author

@baktun14 @Redm4x another thing is I noticed that console is served on port 3001 https://github.com/akash-network/cloudmos/blob/main/apps/deploy-web/deploy.yml#L15 which basically means that Nginx is unused. So I removed the config and relevant steps in the Dockerfile. Let me know if I'm missing anything.

@ygrishajev ygrishajev force-pushed the feature/compose branch 5 times, most recently from e8994af to f4fcfb9 Compare June 19, 2024 11:53
README.md Outdated Show resolved Hide resolved
@ygrishajev ygrishajev merged commit e9af5f6 into main Jun 21, 2024
6 checks passed
@ygrishajev ygrishajev deleted the feature/compose branch June 21, 2024 07:22
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.

3 participants