Skip to content

A data collection and retrieval application to automate and standardize the data intake for the yearly Health of Canadians report

Notifications You must be signed in to change notification settings

alemgeb/cpho-phase2

 
 

Repository files navigation

CPHO Phase 2

Docker Image CI

Note: This is very much a work in progress. Work needs to be done to transform this prototype into an usable production application.

How to run locally

These instructions are aimed at getting the whole system running for development purposes. The frontend and server folders contain details on running those specific services without Docker.

Docker

You'll need to Install Docker and have it running

Creating credentials

We need server and database credentials to be created in the server folder:

cat <<-'EOF' > server/postgres.env
POSTGRES_USER=cpho_user-admin
POSTGRES_PASSWORD=123
POSTGRES_DB=cpho_dev
EOF

We'll need some matching credentials for the server. To generate a secret key, you can use tools such as RandomKeygen to generate a strong key.

cat <<-'EOF' > server/server.env
DEBUG=True
ALLOWED_HOSTS=localhost,127.0.0.1
DB_NAME=cpho_dev
DB_USER=cpho_user-admin
DB_PASSWORD=123
DB_HOST=postgres
DB_PORT=5432
SECRET_KEY= # ADD GENERATED KEY HERE #
# PGADMIN CONTAINER
PGADMIN_DEFAULT_EMAIL=admin@example.com
PGADMIN_DEFAULT_PASSWORD=123
PGADMIN_LISTEN_PORT=5433
PGADMIN_CONFIG_SERVER_MODE=False
PGADMIN_CONFIG_MASTER_PASSWORD_REQUIRED=False
PGADMIN_CONFIG_UPGRADE_CHECK_ENABLED=False
EOF

Running it!

Run docker compose up -d in the root directory of the project.

Docker should have created 4 containers:

  • cpho-envoy: the lightweight reverse proxy
  • cpho-postgres: PostgreSQL database
  • cpho-server: Django Server
  • cpho-frontend: React Frontend

Now, you can do the following:

  • Navigate to localhost:3000 to view the frontend
  • Navigate to localhost:3000/graphql to view the GraphQL interface

When you're done working, you can run docker compose down to stop the containers

About

A data collection and retrieval application to automate and standardize the data intake for the yearly Health of Canadians report

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 80.1%
  • Python 16.3%
  • HTML 1.7%
  • Dockerfile 1.6%
  • JavaScript 0.3%