This repository is here to hold all insalan.fr infrastructure.
Please read carefully the CONTRIBUTING.md file before any contribution.
If you are on Windows, you will first need to install WSL and then Docker Desktop. Otherwise, simply install Docker Engine on its own.
Then :
git clone [email protected]:InsaLan/infra-insalan.fr.git --recurse-submodules
cp .env.dist .env
chmod 0600 .envEdit your .env with your local settings. For Windows frontend development, make sure to uncomment the WATCHPACK_POLLING and CHOKIDAR_USEPOLLING lines. Then:
docker compose -f docker-compose-beta.yml up --build -dYou can also launch the beta synchronously to get the logs:
docker compose -f docker-compose-beta.yml up --buildThen to stop the containers:
docker compose -f docker-compose-beta.yml downThe website is available at the value of WEBSITE_HOST which should be
insalan.fr or insalan.localhost depending on where it's running. It's API
backend is available at api.WEBSITE_HOST.
The "beta" environment is available at beta.WEBSITE_HOST and it's own API at
api.beta.WEBSITE_HOST. There is hotreload for the front (with
vite), back (with django runserver), and nginx (thanks to a
custom script).
Put 0 in the .env file for the DEV variable.
Run the following command:
docker compose -f docker-compose.yml build
docker compose -f docker-compose.yml up -dTo stop the prod environment:
docker compose -f docker-compose.yml downThe dev frontend is available at WEBSITE_HOST and it's API at
api.WEBSITE_HOST.
It's important to run the tests to ensure that you didn't break anything.
docker exec infra-insalanfr-beta-backend-1 python manage.py test --parallel autoA makefile has been created to create shortcut for the command presented above. For example, you can launch the beta just by typing:
make run-betaAnd you can run the tests with
make test-backDocker can take a lot of disk space with all the images. You have a few options to clean it up:
make clean-allwill remove all the containers and imagesmake clean-customwill remove all the custom images (the ones we build and not the ones we pull from docker hub)