Skip to content

Pragyan Acharya #25159

@pragyana2503-cyber

Description

@pragyana2503-cyber

Is this a docs issue?

  • My issue is about the documentation content or website

Type of issue

Information is incorrect

Description

Use an official Python runtime as the base image

FROM python:3.8-slim-buster

Set the working directory in the container

WORKDIR /app

Copy application files into the container

COPY .

Install dependencies

RUN pip install -r requirements.txt

Expose port 5000 for Flask

EXPOSE 5000

Command to run the application

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

Location

https://docs.docker.com/get-started/

Suggestion

from flask import Flask

app = Flask(name)

@app.route('/')
def home():
return "Hello, Flask with Docker!"

if name == "main":
app.run(host="0.0.0.0", port=5000)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions