-
Copy the template
docker/local/.env.exampletodocker/local/.env.. -
Set the variables as you wish. Below you have an example:
# Project configuration COMPOSE_PROJECT_NAME=python-flask-template # Make settings DEFAULT_DIR=src SRC_BUILD=true PYTHON_BUILD=true POSTGRESQL_BUILD=true # Docker DOCKER_SRC_DIR='src' ## Options are: 'src' or '.'. The options depends on 'SRC_BUILD' parameter. DOCKER_NETWORK_NAME=local DOCKER_NETWORK_CIDR=192.17.210.0/24 DOCKER_VOLUME_DB=db-data # Flask application PYTHON_DOCKERFILE='./docker/local/python-flask/Dockerfile' PYTHON_CONTAINER_NAME=flask PYTHON_BASE_IMAGE=python:3.11 PYTHON_IMAGE_NAME="novadevs/${COMPOSE_PROJECT_NAME}-${PYTHON_CONTAINER_NAME}:latest" PYTHON_EXTERNAL_PORT=5000 PYTHON_INTERNAL_PORT=5000 # PostgreSQL database POSTGRES_CONTAINER_NAME=postgres POSTGRES_BASE_IMAGE=postgres:15.4-bullseye POSTGRES_IMAGE_NAME="novadevs/${COMPOSE_PROJECT_NAME}-${POSTGRES_CONTAINER_NAME}:latest" POSTGRES_DATABASE=db_novadevs POSTGRES_USER=dba_novadevs POSTGRES_PASSWORD=Dba_2023 ## The password cannot contain special characters, otherwise, the 'connect-db' will not work POSTGRES_EXTERNAL_PORT=56432 POSTGRES_INTERNAL_PORT=5432
About the 'Make settings' variables:
- DEFAULT_DIR: Do no touch this value. The name of the default folder where the code is located, by default is
src. This variable is used in thebuild-structureargument ofmakecommand to create the initial directory structure of the project. - SRC_BUILD_: Checks if the project will have a src folder. If it is set to
false, the variableDOCKER_SRC_DIRmust change to.. - POSTGRESQL_BUILD_: Checks if the project will use PostgreSQL or not.
- PYTHON_BUILD_: Checks if the project will use Flask or Python.
- DEFAULT_DIR: Do no touch this value. The name of the default folder where the code is located, by default is
-
Run
makecommand to see the options you have available. -
Run
make -s build-structureto configure the directory structure of the project. NOTE: This command must be run initially and just once. -
Run
make -s buildto build the project from scratch.
local
Directory actions
More options
Directory actions
More options
local
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
parent directory.. | ||||