https://github.com/yevheniidatsenko/goit-pythonweb-hw-02
📂 Hometask - FullStack Web Development with Python (Docker fundamentals)
https://github.com/yevheniidatsenko/goit-pythonweb-hw-02
docker-compose fastapi goit-pythonweb-hw-02 postgresql pyhton
Last synced: 7 months ago
JSON representation
📂 Hometask - FullStack Web Development with Python (Docker fundamentals)
- Host: GitHub
- URL: https://github.com/yevheniidatsenko/goit-pythonweb-hw-02
- Owner: yevheniidatsenko
- Created: 2025-01-12T20:17:27.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-01-18T15:22:53.000Z (9 months ago)
- Last Synced: 2025-01-18T16:19:01.272Z (9 months ago)
- Topics: docker-compose, fastapi, goit-pythonweb-hw-02, postgresql, pyhton
- Language: Python
- Homepage:
- Size: 615 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# FastAPI Application Deployment with Docker
## Task Overview
This task involves deploying a FastAPI application using Docker. You will clone the application repository, set it up, and run it in a Docker container. Finally, you will verify the application's functionality and database connectivity.
## Steps to Complete the Task
1. **Clone the Repository**
```bash
git clone https://github.com/GoIT-Python-Web/FullStack-Web-Development-hw2
cd FullStack-Web-Development-hw2
```2. **Create a Dockerfile**
- Create a `Dockerfile` with instructions to build the Docker image for the application.
3. **Write docker-compose.yaml**
- Create a `docker-compose.yaml` file with the configuration for the application and PostgreSQL.
4. **Modify Database Connection**
- Update the `SQLALCHEMY_DATABASE_URL` in `conf/db.py`:
```python
SQLALCHEMY_DATABASE_URL = f"postgresql+psycopg2://postgres:567234@:5432/hw02"
```5. **Build and Run the Environment**
```bash
docker-compose up
```6. **Verify Application Functionality**
- Open your browser and check the application.
- Click the "Check DB" button to confirm database connectivity.## Expected Results
- **Application Home Page**
- **Database Check Result**
- **Docker**
