Skip to content

Commit

Permalink
Merge pull request #330 from pkpdapp-team/i328-prod-issues
Browse files Browse the repository at this point in the history
#328 add tutorial video csv info to readme
  • Loading branch information
martinjrobins authored Jan 10, 2024
2 parents 9f9b91c + 95d9196 commit 2a0b18f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 22 deletions.
1 change: 0 additions & 1 deletion .env.prod
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
DEBUG=1
HOST_NAME=monkshood
SECRET_KEY=aLargeRandomSecretKey
POSTGRES_PASSWORD=sekret2
DATABASE_URL=postgres://postgres:sekret2@postgres:5432/postgres

RABBITMQ_DEFAULT_USER=guest
Expand Down
28 changes: 18 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,16 @@ $ cd pkpdapp

### `.env.prod` file

The configuration of the production application is stored in the `.env.prod` file in the root directory. Edit this file and variables to correspond to your particular setup. The variables are described below:
The configuration of the production application is stored in the `.env.prod` file in the root directory. Edit this file and variables to correspond to your particular setup, in particular make sure `HOST_NAME`, `DATABASE_URL` is set correctly and that `SECRET_KEY` is altered from the default. The variables are described below:

- `DEBUG`: set to 0 for production
- `HOST_NAME`: the host name of the application
- `SECRET_KEY`: a large random string used for cryptographic signing
- `POSTGRES_PASSWORD`: password for postgres database specified in `docker-compose.yml` (not needed if using your own database)
- `DATABASE_URL`: URL of a postgres database (e.g. postgres://username:password@postgres:5432/postgres). Do not alter this if you are using the
postgres service in the `docker-compose.yml` file.
- `DATABASE_URL`: URL of a postgres database (e.g. postgres://username:password@postgres:5432/postgres). Note that any special characters in the password must be url-encoded. E.g. `postgres://user:p#ssword!@localhost/foobar` should be written as `postgres://user:p%23ssword!@localhost/foobar`.

and should instead be passed as:



- `RABBITMQ_DEFAULT_USER`: username for rabbitmq server (optional)
- `RABBITMQ_DEFAULT_PASS`: password for rabbitmq server (optional)
Expand Down Expand Up @@ -66,13 +68,19 @@ in the root folder (this folder needs to be created) and named `pkpdapp.crt` and

### PostgreSQL database

The application uses a PostgreSQL database. You can either supply your own
database and set the `DATABASE_URL` variable in the `.env.prod` file, or the
`docker-compose.yml` file contains a postgres service that can be used, along
with the `DATABASE_URL` variable already set in the `.env.prod` file.
The application uses a PostgreSQL database. You should supply your own
database and set the `DATABASE_URL` variable in the `.env.prod` file appropriately.

### Help pages & Tutorials

To add tutorial videos to the application, you will need to create a csv file with the following columns (the first line of the csv file should be the column names):

- `Title`: title of the video
- `Type`: tab in which the video will be displayed (either `Tutorial X` where `X` is a number, `Project`, `Drug`, `Model`, `Trial Design` or `Simulation`)
- `Link`: link to the video
- `Keywords`: keywords associated with the video (optional)

If you are using your own database, you can delete the postgres service from the
`docker-compose.yml` file.
This file should be placed in the `pkpdapp/static/` directory and named `tutorial_videos.csv`.

### Containers

Expand Down
11 changes: 0 additions & 11 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,6 @@ version: "2"
volumes:
db:
services:
postgres:
image: "postgres"
stop_signal: SIGINT # Fast Shutdown mode
command: -p 5432
ports:
- "5432:5432"
env_file:
- ./.env.prod
restart: unless-stopped
volumes:
- db:/var/lib/postgresql/data
rabbitmq:
image: rabbitmq:3-management-alpine
env_file:
Expand Down

0 comments on commit 2a0b18f

Please sign in to comment.