https://github.com/danijeldragicevic/flask-app-dockerized
Simple Python (Flask) app. Containerized with Docker.
https://github.com/danijeldragicevic/flask-app-dockerized
docker flask hyperskill-solutions python3
Last synced: 2 months ago
JSON representation
Simple Python (Flask) app. Containerized with Docker.
- Host: GitHub
- URL: https://github.com/danijeldragicevic/flask-app-dockerized
- Owner: danijeldragicevic
- License: apache-2.0
- Created: 2024-10-17T11:47:57.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-18T07:30:16.000Z (about 1 year ago)
- Last Synced: 2024-12-28T00:43:08.668Z (about 1 year ago)
- Topics: docker, flask, hyperskill-solutions, python3
- Language: Dockerfile
- Homepage:
- Size: 10.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Flask App - Dockerized
This is Python web application with a single endpoint (/) exposed on port 8000.
The application is containerized using the Docker.
# Technology
- Python 3.13.0
- Flask 2.3.2
- Docker 27.2.0
# To run without Docker
1. Create the Virtual Environment:
```
$ python3 -m venv venv
```
2. Activate the Virtual Environment:
```
$ source venv/bin/activate # on macOS and Linux
$ venv\Scripts\activate # on Windows
```
3. Install Dependencies:
```
$ pip install -r requirements.txt
```
4. Run the Application:
```
$ python main.py
```
5. Test the Application
```
$ curl http://localhost:8000/
```
Expected result:
```
{"first_name":"Hyper","id":"90","last_name":"Skill"}
```
# To run with the Docker
1. Navigate to the project root directory and build the Image:
```
$ docker build -t flask-app .
```
2. Run the Docker Container:
```
$ docker run -d -p 8000:8000 flask-app
```
3. Test the Application:
```
$ curl http://localhost:8000/
```
Expected result:
```
{"first_name":"Hyper","id":"90","last_name":"Skill"}
```
# Licence
[](https://opensource.org/licenses/Apache-2.0)