This document provides instructions for working with the workshop files, managing Docker containers, cleaning up volumes, and using the Python and TailwindCSS environments.
This project uses Docker Compose to set up and manage the environment. Here are the essential Docker commands for starting, stopping, and cleaning up the environment.
To start the Docker containers for Moodle, MariaDB, and Nginx, run the following command from the environment/
directory:
docker-compose up -d
This command will:
- Build the services if they are not already built.
- Start the containers in the background (detached mode).
To stop the running containers without removing the volumes (i.e., without losing data):
docker-compose stop
This will gracefully stop the containers, but the data will remain persisted.
If you want to remove the containers and clean up the associated data (volumes), run:
docker-compose down --volumes
This will stop the containers and delete the associated volumes, meaning any persisted data (e.g., Moodle database) will be removed.
To ensure the domains platform.ltitraining.net
and tool.ltitraining.net
resolve to your local environment, make sure your /etc/hosts
file is updated.
Open the /etc/hosts
file in a text editor with administrator privileges:
sudo nano /etc/hosts
See Activity 1 for more details
If you need to modify or regenerate the CSS, you can run TailwindCSS in watch mode. This allows you to automatically generate new CSS when changes are made.
To run TailwindCSS in watch mode:
- Navigate to the relevant code directory (i.e. activity):
cd activity
- Run the following command:
npx tailwindcss -i ./static/css/input.css -o ./static/css/output.css --watch
This will watch the input.css
file for changes and regenerate output.css
as you modify the styles.
Since the output.css
file is already included in the sample code, Node.js and TailwindCSS are optional dependencies. You only need to run this step if you're modifying the CSS styles.
If you want to completely reset the environment, including removing any persisted data, follow these steps:
-
Stop the Docker containers:
docker-compose stop
-
Remove the containers and volumes:
docker-compose down --volumes
-
Update or clean the hosts file (if necessary) to remove any entries related to
platform.ltitraining.net
andtool.ltitraining.net
.
This document covers:
- Managing Docker containers (
up
,stop
,down
with volumes). - Updating the
hosts
file for proper domain resolution. - Running
npx tailwind
in watch mode to regenerate CSS. - Cleaning up persisted data and volumes.
Make sure to refer back to this document when working with the project during the workshop.