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

Configuration to deploy using compose #583

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Conversation

lunika
Copy link
Member

@lunika lunika commented Jan 28, 2025

Purpose

To ease the deployment of the application on infrastructure not running
k8s we created a compose file ready for production.

Proposal

  • rename compose file
  • remove usage of dockerize
  • create a config to deploy docs using compose in production
  • add documentation to install docs in production using compose

Improvement

  • [] manage certbot in the compose configuration

Fix #561

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.
@lunika lunika added enhancement New feature or request docker labels Jan 28, 2025
@lunika lunika requested review from virgile-dev and AntoLC January 28, 2025 11:38
@lunika lunika self-assigned this Jan 28, 2025
Copy link
Collaborator

@virgile-dev virgile-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Manuel !

@lunika lunika requested a review from virgile-dev January 28, 2025 15:32
Copy link
Collaborator

@virgile-dev virgile-dev left a 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 !

Copy link
Collaborator

@AntoLC AntoLC left a 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 ?

@virgile-dev virgile-dev added the documentation Improvements or additions to documentation label Jan 30, 2025
@VolkerFelix
Copy link

VolkerFelix commented Mar 21, 2025

@lunika I just deployed Docs on my ubuntu homer server with the base of this PR. Was very helpful! Thank you.
What is blocking the merge? I think this would be very useful for other users as well.

Copy link

@VolkerFelix VolkerFelix left a 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

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.

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

  1. Check logs for specific services:

    COMPOSE_FILE=compose.production.yaml ./bin/compose logs -f service_name
  2. 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docker documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add docker compose up production configuration
4 participants