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.
-
Clone the repository:
git clone <repository_url> cd <repository_directory>
-
Make your own compose:
cp docker-compose.yaml.example docker-compose.yaml
-
Build and start the application using Docker Compose:
docker-compose up --build -d
-
Access the FastAPI application: The FastAPI application will be available at
http://localhost:8080.
The requirements.txt file includes the following dependencies:
fastapi>=0.111.0
pydantic>=2.7.0
uvicorn>=0.29.0
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.
- PostgreSQL database service and PGAdmin4.
If you wish to contribute to this project, please follow these steps:
- Clone this repository.
- Create a new branch (
git checkout -b feature/your-feature). - Commit your changes (
git commit -am 'Add new feature'). - Push to the branch (
git push origin feature/your-feature). - Create a new Pull Request.
For any questions or issues, please contact the project maintainer at nycu1sdc@gmail.com.