-
Notifications
You must be signed in to change notification settings - Fork 2
Installation for Deployment
UMIL requires Docker Engine with Compose V2. Make sure the remote server has both installed.
Staging server umil.staging.linkedmusic.ca and Production server umil.linkedmusic.ca uses docker-compose-deployment.yml file instead of the default compose file (which is use for development)
To begin, SSH into the appropriate server:
-
For the staging server, run:
ssh ddmal.stage.VIM -
For the production server, run:
ssh ddmal.prod.VIM
After cloning the repository, create a local .env file. You can do this by copying or renaming the .env.sample file:
cp .env.sample .envUpdate the .env file by uncommenting and setting the required environment variables:
-
POSTGRES_USER– the PostgreSQL username -
POSTGRES_PASSWORD– a strong password for the database (ensure this is secure) -
DJANGO_SECRET_KEY– a secure secret key for your Django application
Also, ensure the following:
-
HOST_NAMEis set to the domain name where the UMIL instance will be hosted (e.g.,umil.linkedmusic.caorumil.staging.linkedmusic.ca)
Then run the following commands to build and start the containers for Production mode:
docker compose -f docker-compose-deployment.yml build
docker compose -f docker-compose-deployment.yml up -dIf the server has already been set up, SSH into the server and run:
cd /virtual_instrument_museum/To run Docker-related commands, you may need admin access.
Sometimes, Server Error 500 appears on most pages. Enable DEBUG = True to trace the issue!
This could be due to Django-Vite not able to see proper static files. To fix, SSH to the server, docker exec -it vim-app bash to get into the container and run the following commands:
# Install npm
cd frontend/
apt update
apt install npm -y
# Build frontend, similar to `prod-frontend` stage
npm install
npm run sass:build
npm run build
# Collect static files into `static/` folder
cd ../vim-app
python manage.py collectstaticIf changes doesn't applied, run docker compose stop and docker compose -f docker-compose-production.yml up -d to restart the containers.