Link: Github Repository
Reach me out via LinkedIn, Portfolio Contact Form or mail@pascal-nehlsen.de
Conduit Deploy with Docker Compose
Table of Contents
Description
This repository sets up a multi-container environment using Docker Compose to run both the Conduit Frontend and Conduit Backend applications.
The Conduit Frontend is forked from
Developer-Akademie-GmbH/conduit-frontend,
and the Conduit Backend is forked from
https://github.com/Developer-Akademie-GmbH/conduit-backend and integrated as submodules.
Both the frontend and backend are containerized, and Docker Compose is used to orchestrate their operation, ensuring they work seamlessly together. This setup provides a consistent and scalable development environment, simplifying the process of running both applications in parallel.
Quickstart
Prerequisites
Ensure you have the following tools installed:
-
- Docker Compose was included with Docker versions 20.10 and later, but recently it is no longer included by default. For the latest Docker versions, you will need to install Docker Compose manually as a plugin. Follow the official instructions for detailed steps.
-
For a Frontend Quickstart, refer to the Conduit Frontend README
-
For a Backend Quickstart, refer to the Conduit Backend README
-
Clone the repository:
git clone https://github.com/PascalNehlsen/conduit.git
cd conduit -
Copy the
example.envfile to.env:cp example.env .env -
Init submodules
git submodule update --init --recursive -
Build and start the application using Docker Compose:
docker-compose up --build -d -
Access the application:
- The Frontend should be accessible at
http://localhost:8282in your web browser. - The Backend should be accessible at
http://localhost:8000/adminin your web browser.
- To stop the application, use:
docker-compose down
Usage
Once the application is running, you can interact with the Conduit API via the Backend at http://localhost:8000. The Frontend will communicate with the API to fetch and display data.
Configuration
You need to configure several environment variables for the Django project to work properly. Below is an example of the necessary variables to set in your example.env file:
| Variable | Description | Default value |
|---|---|---|
DJANGO_SUPERUSER_USERNAME | The username for the Django admin superuser. | admin |
DJANGO_SUPERUSER_EMAIL | The email address associated with the Django admin superuser. | admin@example.com |
DJANGO_SUPERUSER_PASSWORD | The password for the Django admin superuser | adminpassword |
SECRET_KEY | A crucial security key used by Django for cryptographic signing | example.env#SECRET_KEY |
DEBUG | Set to True for local development to enable debugging features. | False |
ALLOWED_HOSTS | A comma-separated list of allowed hostnames or IP addresses that your Django site can serve. | 127.0.0.1, localhost |
CORS_ALLOWED_ORIGINS | A list of allowed origins for cross-origin requests. | http://localhost:8282 |