Skip to content

Installation for Deployment

Antoine Phan edited this page Sep 22, 2025 · 7 revisions

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

Initial Server Setup

After cloning the repository, create a local .env file. You can do this by copying or renaming the .env.sample file:

cp .env.sample .env

Update 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_NAME is set to the domain name where the UMIL instance will be hosted (e.g., umil.linkedmusic.ca or umil.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 -d

Subsequent Runs

If 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.

In case something goes wrong

Sometimes, Server Error 500 appears on most pages. Enable DEBUG = True to trace the issue!

Prod mode build doesn't include newly added TypeScript/CSS files as static

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 collectstatic

If changes doesn't applied, run docker compose stop and docker compose -f docker-compose-production.yml up -d to restart the containers.

Clone this wiki locally