-
Notifications
You must be signed in to change notification settings - Fork 266
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
Configuration to deploy using compose #583
base: main
Are you sure you want to change the base?
Conversation
The compose configuration preferred filename is now compose.yaml docker-compose.yml is the legacy one used by docker-compose v1
Compose is able to manage service status to be healthy in its dependecies. Configuring a healthcheck on services then defining a condition on the depends_on settings allow to remove dockerize
To ease the deployment of the application on infrastructure not running k8s we created a compose file for production.
Write the documentation related to the docker compose installation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Manuel !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All good on the documentation part !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's nice.
So https://getdocs.now/ is using it, it is that ?
@lunika I just deployed Docs on my ubuntu homer server with the base of this PR. Was very helpful! Thank you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Don't see where you run the DB migrations for the prod env though
stop-production: ## Stop compose project in production mode | ||
@$(COMPOSE_PRODUCTION) stop | ||
.PHONY: stop-production | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my version I added this:
deploy: ## Deploy the application in production mode (includes migrations)
@echo "Starting deployment..."
@echo "1. Starting required services..."
@$(COMPOSE_PRODUCTION) up -d postgresql redis minio
@echo "2. Waiting for PostgreSQL to be ready..."
sleep 5
@echo "3. Running database migrations..."
@$(COMPOSE_PRODUCTION) run --rm backend python manage.py migrate --noinput --skip-checks
@echo "4. Starting all services..."
@$(COMPOSE_PRODUCTION) up -d
@echo "Deployment complete!"
.PHONY: deploy
Or do you run the db migrations somewhere else?
Makefile commands available: | ||
- `make bootstrap-production`: create the configuration files in `env.d/production`, create the directories : `data/production`. Both directories must be backup, if you loose them you loose all the data related to the application. | ||
- `make run-production`: up the ingress containers. Will start all the containers needed in cascade. | ||
- `make stop-production`: stop all the containers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe you could add a Troubleshooting section. Helped me a lot to debug the different issues I faced:
Troubleshooting
-
Check logs for specific services:
COMPOSE_FILE=compose.production.yaml ./bin/compose logs -f service_name
-
Common issues:
- If user collaboration doesn't work, check Y-provider logs and CORS settings
- If authentication fails, verify Keycloak client settings and secrets
- For SSL issues, ensure certificates are properly mounted and configured
Purpose
To ease the deployment of the application on infrastructure not running
k8s we created a compose file ready for production.
Proposal
Improvement
Fix #561