-
Notifications
You must be signed in to change notification settings - Fork 4
RBD Installation
To deploy a production instance of Roundabout, you need to have the following items in place:
- A web server with ports 80 and 443 available
- Docker and Docker Compose installed on the server - instructions
- Git installed on the server
Roundabout relies heavily on environmental variables. The environmental variables include secrets like database usernames/passwords.
These variable should NOT be kept in version control. The repository includes a .envs.example
directory that you can use as
a template to create your own .envs
directory and files. Roundabout requires this ".envs" directory to be in the application root level directory. (ex. environmental variables file path: .envs/.production/.django)
.envs/
-- .production/
-- .django
-- .postgres
-- .local/
-- .django
-- .postgres
The environmental variables include several standard required Django settings that you should update to your own values, including:
- DJANGO_SECRET_KEY
- DJANGO_ALLOWED_HOSTS
- POSTGRES_HOST
- POSTGRES_PORT
- POSTGRES_DB
- POSTGRES_USER
- POSTGRES_PASSWORD
In addition to standard Django variables, Roundabout uses some custom environmental variables to set the pattern for the auto-generation of Serial Numbers. There are several options available for you to choose from in the .env/production/django
file:
- If you want to enable basic Serial Number auto-generation, set the
RDB_SERIALNUMBER_CREATE
variable toTrue
. This will create Serial Numbers with a basic numeric pattern - "1, 2, 3, ... etc." - If you want to use the Serial Number pattern recommended by OOI, then also set the
RDB_SERIALNUMBER_OOI_DEFAULT_PATTERN
variable toTrue
. This will create Serial Numbers with the following pattern: "Part Number" + "-20001, -20002, -20003, etc."
The Docker production deployment uses a NGINX container as a web server and proxy to the Django app. An example NGINX conf file (nginx-example.conf.EXAMPLE
) is included in the /compose/production/nginx/
directory that you can use as a template for HTTP or HTTPS deployment.
If using SSL, you also need to upload your SSL certificates to the the application root level directory in a new /.ssl/certs/
directory. These will be copied into the NGINX container when Docker builds the containers. This directory should also NOT be kept in version control. If you're not using SSL (you should really use SSL), comment out the following line in the production.yml file and update the NGINX conf file accordingly:
volumes:
- production_nginx:/var/log/nginx
- ./.ssl/certs:/etc/ssl/certs/ # bind a local directory with the SSL certs <-- REMOVE THIS LINE
- Clone the repository to whatever directory on your server you want to use.
- Upload your NEW
.envs
directory and.ssl
directory (if using) to the application root directory. - Run the following Docker Compose commands:
docker-compose -f production.yml build
docker-compose -f production.yml up -d
- You're done! Site should be available at whatever domain you specified in NGINX.
Not that your site is up and running, you can login by clicking the "Sign In" link and using the default user credentials created when the site was spun up for the first time. These credentials are set in the .env/production/django
file, and -- unless you changed them before starting the site -- default to:
- Username: admin
- Password: admin
You should update these immediately after logging in the first time by clicking the "My Profile" link.
See detailed cookiecutter-django documentation