Deployment#
Config Variables#
PACManWeb needs access to a .env file to work, which needs to be present in the root of the repository.
The variables in the .env file depend on whether you want to deploy in production or in development. Here is for example the .env file for production.
SECRET_KEY=
ADS_DEV_KEY=
ENV_NAME=base
# your platform name- linux or macos
OS_NAME=linux
# password for the mainadmin user. this can be changed once logged in
MAINADMIN_USER_PASSWORD=
# available at /flower, userful for monitoring processes
FLOWER_BASIC_AUTH=username:password
# available at /redis-commander, useful for monitoring database
REDIS_COMMANDER_USER=
REDIS_COMMANDER_PASSWORD=
# ssl and nginx config
DOMAIN_NAME=yourdomain.com
SSL_CERT_FILE=/path/to/your/certificate.crt
SSL_KEY_FILE=/path/to/your/private.key
# WARNING: do not edit below variables
CELERY_RESULT_BACKEND=redis://redis:6379/0
CELERY_BROKER_URL=amqp://guest:guest@rabbitmq:5672
SUBPROCESS_COMMANDS=micromamba run -n ${ENV_NAME} python run_pacman.py
REACT_APP_BASE_URL=http://0.0.0.0:8080
REACT_APP_API_URL=http://0.0.0.0:8000
ADS_DEV_KEYis the key that PACMan would use to access the ADS Database.You can also add an optional
SECRET_KEYthat can be generated by runningpython -c 'import secrets; print(secrets.token_hex())'. TheSECRET_KEYwill keep your sessions persistent across deployments. In production however we’d recommend you to not use this unless necessary since you’d want to refresh your client side sessions after updates.
Production Setup#
Make a copy of
.env.prodand enter your values. Make sure there is a password for the the main admin user.For SSL, generate a certificate and key pair and move those to nginx/ssl folder. Provide the name of both in
SSL_CERT_FILEandSSL_KEY_FILErespectfully.Run
docker compose up -dto start the server. Your production server should be visible at port 80/443.
Local Development#
Make a copy of
.env.devand enter your values. Make sure there is a password for the the main admin user.For dev server there is no auth for /flower or /redis-commander
Run
docker compose -f docker-compose-dev.yml upto start the server. Your development server should be visible at http://localhost:8080/.