This project is designed specifically for programs related to FastAPI. It aims to allow students to focus on learning FastAPI without worrying about environment setup. The project includes the necessary configurations and dependencies to start quickly and easily.
Make sure you have the following software installed on your machine:
- Git
- Docker Desktop or Docker Engine
The project is structured as follows:
requirements.txt
: Lists the Python dependencies required for the project.Dockerfile
: Contains the instructions to build the Docker image for the FastAPI application.docker-compose.yaml
: Defines the services and configurations for running the project using Docker Compose.app/
: Directory containing the FastAPI application code.members/
: Directory for storing each participant's assignments as Git submodules. Each participant should add their own repository as a submodule undermembers/
using the following steps in members/README.md.
git clone <repository_url>
cd <repository_directory>
cp docker-compose.yaml.example docker-compose.yaml
mkdir -p app
touch app/requirements.txt
touch app/main.py
Tip
You can copy requirements.txt.example
file into app
directory and rename to app/requirements.txt
Note
Please make sure that main.py
is not empty.
docker-compose up --build -d
The FastAPI application will be available at http://localhost:8080
.
The Dockerfile
sets up the environment for the FastAPI application. It includes the following key steps:
- Use an official Python base image.
- Set the working directory.
- Copy the necessary files.
- Install the required Python packages.
- Specify the command to run the FastAPI application.
The docker-compose.yaml
file defines the services required for the application. It includes:
- The FastAPI service, built from the Dockerfile.
- Configuration for environment variables and port mappings.
- MariaDB database service and PHPMyAdmin.
If you wish to contribute to this project, please follow these steps:
- Fork this repository to your own GitHub account.
- Clone the forked repository to your local machine.
- Create a new branch (
git checkout -b feature/your-feature
). - Make your changes and commit them (
git commit -am 'Add new feature'
). - Push the changes to your forked repository (
git push origin feature/your-feature
). - Go to the original repository on GitHub and create a Pull Request from your forked repository.
For any questions or issues, please contact the project maintainer at [email protected].