Sign inSign up

irushah/app

By irushah

•Updated over 2 years ago

Simple web app using flask. This will print the hostname,date time & time zone

Image
Networking
0

988

irushah/app repository overview

Flask App Docker Container

This Docker container hosts a Flask web application that displays system information including the hostname, current date, and time zone.

How to Run: Pull the Docker Image:

bash Copy code docker pull irushah/app Run the Docker Container:

bash Copy code docker run -dp 80:5000 irushah/app Access the Web App: Open a web browser and navigate to http://localhost/⁠ to view the Flask web app.

Requirements: Docker installed on your system Flask app files organized in a directory structure Dockerfile specifying the build instructions requirements.txt listing Python packages Directory Structure: bash Copy code /app ├── app.py ├── requirements.txt └── templates └── index.html Dockerfile: Dockerfile Copy code

⁠Use the official Python image from the Docker Hub

FROM python:3.10-slim

⁠Set the working directory in the container

WORKDIR /app

⁠Copy the current directory contents into the container at /app

COPY . /app

⁠Install any needed packages specified in requirements.txt

RUN pip install --no-cache-dir -r requirements.txt

⁠Make port 5000 available to the world outside this container

EXPOSE 5000

⁠Define environment variable

ENV NAME World

⁠Run the Flask app

CMD ["python", "app.py"]

Tag summary

Content type

Image

Digest

sha256:857b8d996…

Size

56.4 MB

Last updated

over 2 years ago

docker pull irushah/app