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

Docker setup for Avni Server #649

Merged
merged 3 commits into from
Nov 24, 2023
Merged

Conversation

thundersparkf
Copy link
Contributor

Containerised Avni-server using Docker and Docker Compose

Although there is a avniproject/avni-docker, it does not seem to be updated. I could not find an active issue for containerisation so I could not mention it in the PR.

Docker build

docker build -f docker/Dockerfile -t avni-server:latest .  

Docker Compose

Create a copy of the docker/.env.example file using:

cp docker/.env.example docker/.env

And update docker/.env with the require environment variables and values

There are two files:

  1. docker/docker-compose.yml - Contains the Avni service
  2. docker/docker-compose.db.yml - Contains the Postgres service and Database initialising service that runs the initial SQL script(make build_server)

Run on temporary local database

docker compose -f docker/docker-compose.yml -f docker/docker-compose.db.yml up  

This will deploy a Postgres container. Please ensure that the OPENCHS_DATABASE_HOST value matches the name of database service key in docker/docker-compose.db.yml(default: db).

Run on remote database

Assuming that the initialisation scripts are all executed on the remote database, run:

docker compose -f docker/docker-compose.yml up  

Tear down

docker compose -f docker/docker-compose.yml up  

If the local database was used

docker compose -f docker/docker-compose.yml -f docker/docker-compose.db.yml up  

Please let me know if there's concerns or issues.

@ashusvnath ashusvnath merged commit 5d26e46 into avniproject:master Nov 24, 2023
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.

2 participants