{"id":26419029,"url":"https://github.com/junior92jr/fastapi-docker-postgres-devcontainer-seed","last_synced_at":"2026-04-10T02:02:45.528Z","repository":{"id":260247366,"uuid":"880715912","full_name":"junior92jr/fastapi-docker-postgres-devcontainer-seed","owner":"junior92jr","description":"A pre-configured FastAPI project seed designed to streamline development with Docker, PostgreSQL, and Visual Studio Code DevContainers. This template is perfect for developers looking to kickstart a scalable FastAPI app with a PostgreSQL database, all within a containerized, reproducible environment.","archived":false,"fork":false,"pushed_at":"2025-03-09T18:00:10.000Z","size":31,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-09T19:18:13.386Z","etag":null,"topics":["devcontainer","docker","docker-compose","fastapi","postgresql","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/junior92jr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-30T08:16:35.000Z","updated_at":"2025-03-09T18:00:14.000Z","dependencies_parsed_at":"2025-03-09T19:18:16.922Z","dependency_job_id":"eca826a1-c342-4283-b9fd-c05468e96b06","html_url":"https://github.com/junior92jr/fastapi-docker-postgres-devcontainer-seed","commit_stats":null,"previous_names":["junior92jr/fastapi-docker-postgres-devcontainer-seed"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junior92jr%2Ffastapi-docker-postgres-devcontainer-seed","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junior92jr%2Ffastapi-docker-postgres-devcontainer-seed/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junior92jr%2Ffastapi-docker-postgres-devcontainer-seed/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junior92jr%2Ffastapi-docker-postgres-devcontainer-seed/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/junior92jr","download_url":"https://codeload.github.com/junior92jr/fastapi-docker-postgres-devcontainer-seed/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244141572,"owners_count":20404836,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["devcontainer","docker","docker-compose","fastapi","postgresql","python3"],"created_at":"2025-03-18T01:59:48.612Z","updated_at":"2025-12-31T00:17:10.857Z","avatar_url":"https://github.com/junior92jr.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FastAPI Docker PostgreSQL DevContainer Seed\n\n**Description**A pre-configured FastAPI project template designed to streamline development with Docker, PostgreSQL, and Visual Studio Code DevContainers. This template is perfect for developers who want to quickly get started with a scalable FastAPI application using a PostgreSQL database, all within a containerized, reproducible environment.\n\n---\n\n## 🚀 Features\n\n- **FastAPI**: High-performance framework for building APIs with Python 3.7+.\n- **PostgreSQL**: Robust, open-source relational database for data management.\n- **Docker Compose**: Simplified multi-container management for easy setup and isolated development environments.\n- **DevContainers**: Seamless integration with Visual Studio Code, offering a consistent and reproducible development environment.\n- **Standard Docker Setup**: Supports non-VS Code users with a straightforward Docker Compose configuration.\n\n---\n\n## 💡 Getting Started\n\n### Prerequisites\n\nBefore you begin, make sure you have the following installed:\n\n- **Docker** \u0026 **Docker Compose** (for containerization)\n- **Visual Studio Code** (optional, for DevContainer integration)\n- **Git** (to clone the repository)\n\n---\n\n### 🖥️ For Visual Studio Code Users\n\n1. **Clone the repository**:\n\n   ```bash\n   git clone https://github.com/junior92jr/fastapi-docker-postgres-devcontainer-seed.git\n   cd fastapi-docker-postgres-devcontainer-seed\n   ```\n\n2. **Open the project in VS Code**:   Open the project folder in Visual Studio Code.\n\n3. **Automatically configure your DevContainer**:   Once inside VS Code, it will automatically prompt you to reopen the folder inside the DevContainer (defined in `.devcontainer/devcontainer.json`).\n\n4. **Run the application**:   Use Docker Compose to start the FastAPI app along with the PostgreSQL database by running:\n\n   ```bash\n   docker-compose up --build\n   ```\n\n   The application will be running and available at `http://localhost:\u003cport\u003e` (where `\u003cport\u003e` is defined in your `.env` file).\n\n---\n\n### 🛠️ For Non-VS Code Users\n\n1. **Clone the repository**:\n\n   ```bash\n   git clone https://github.com/junior92jr/fastapi-docker-postgres-devcontainer-seed.git\n   cd fastapi-docker-postgres-devcontainer-seed\n   ```\n\n2. **Set up the `.env` file**:   Copy the example `.env_sample` file to create your own `.env` file.\n\n   ```bash\n   cp .env_sample .env\n   ```\n\n3. **Edit the `.env` file (Optional)**:   Open and edit the `.env` file to update any environment variables (e.g., database configurations, API keys).\n\n4. **Build and start the Docker containers**:\n\n   For **older Docker versions** (using `docker-compose`):\n\n   ```bash\n   docker-compose up --build\n   ```\n\n   For **newer Docker versions** (using `docker compose`):\n\n   ```bash\n   docker compose up --build\n   ```\n\n   This will build the necessary images and start the containers, creating the FastAPI app connected to a PostgreSQL database.\n\n5. **Access the application**:   Once the containers are running, open a browser and go to `http://localhost:\u003cport\u003e` (replace `\u003cport\u003e` with the port configured in `.env` or `docker-compose.yml`).\n\n6. **Run in detached mode (Optional)**:   To run the containers in the background, use the `-d` flag:\n\n   For **older Docker versions**:\n\n   ```bash\n   docker-compose up --build -d\n   ```\n\n   For **newer Docker versions**:\n\n   ```bash\n   docker compose up --build -d\n   ```\n\n7. **Stop the containers**:   To stop the containers when you're done, use:\n\n   For **older Docker versions**:\n\n   ```bash\n   docker-compose down\n   ```\n\n   For **newer Docker versions**:\n\n   ```bash\n   docker compose down\n   ```\n\n---\n\n## 🧪 Running Tests\n\n1. **Access the running container**:\n\n   Use the following command to access the app container:\n\n   ```bash\n   docker exec -it \u003ccontainer_name\u003e /bin/bash\n   ```\n\n   Replace `\u003ccontainer_name\u003e` with the name of your app container, which you can find by running:\n\n   ```bash\n   docker ps\n   ```\n\n2. **Navigate to the project directory** (if not already there):\n\n   ```bash\n   cd /path/to/your/project\n   ```\n\n3. **Run the tests**:\n\n   Execute the tests using `pytest`:\n\n   ```bash\n   pytest\n   ```\n\n   You can also specify specific test files or directories:\n\n   ```bash\n   pytest path/to/test_file.py\n   ```\n\n4. **Exit the container**:\n\n   Once done, exit the container:\n\n   ```bash\n   exit\n   ```\n\n---\n\n## 📝 Additional Notes\n\n- If you're using **Docker Desktop**, you can easily manage containers through the GUI interface.\n- This template uses **Docker Compose** to manage multi-container environments for both development and production.\n- The `.env` file includes various environment variables for configuration—make sure to customize it according to your needs.\n- To customize the FastAPI application, simply modify the code in the `app` directory.\n\n---\n\n## 🎯 Contributing\n\nFeel free to fork this project and submit pull requests! Contributions are always welcome.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjunior92jr%2Ffastapi-docker-postgres-devcontainer-seed","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjunior92jr%2Ffastapi-docker-postgres-devcontainer-seed","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjunior92jr%2Ffastapi-docker-postgres-devcontainer-seed/lists"}