This project uses a Makefile to streamline the build and deployment process using Docker. The Makefile includes targets for building and managing Docker containers in different environments. DO NOTE, WHATEVER YOU BUILD LAST WILL TRIGGER ON on make up
- Docker
- Docker Compose
- Make
Ensure you have a .env
file in the root directory with the required environment variables. Default values are used if not provided in the .env
file.
all
: Builds and starts the Docker containers.build
: Builds the Docker containers with the specifiedDOCKER_ENV
.up
: Starts the Docker containers with the specifiedDOCKER_ENV
.down
: Stops the Docker containers.restart
: Restarts the Docker containers.logs
: Shows logs of the Docker containers.
build-dev
: Builds the Docker containers for the development environment.build-prod
: Builds the Docker containers for the production environment.build-debug
: Builds the Docker containers for the debugging environment.
To build and start the Docker containers, run:
make all
To build for the development environment:
make build-dev
To build for the production environment:
make build-prod
To build for the debugging environment:
make build-debug
To start the Docker containers:
make up
To stop the Docker containers:
make down
To restart the Docker containers:
make restart
To view the logs of the Docker containers:
make logs
The .env
file should contain the following variables:
DOCKER_ENV
: The Dockerfile to use (default:Dockerfile.dev
).
Example .env
file:
DOCKER_ENV=Dockerfile.dev
Ensure to adjust the .env
file according to your environment needs.
- The
DOCKER_ENV
variable determines which Dockerfile to use for building the containers. - The default Dockerfile is
Dockerfile.dev
. Override this by specifying a differentDOCKER_ENV
in the Makefile targets or the.env
file.