docker pull imvickykumar999/flask-admin:latest
docker run -p 5000:5000 imvickykumar999/flask-admin:latest
docker pull ghcr.io/imvickykumar999/flask-cms-gunicorn:latest
docker run -p 5000:5000 ghcr.io/imvickykumar999/flask-cms-gunicorn:latest
docker-compose up --build
-
This will build the image (if needed) and start the Flask app at http://localhost:5000.
-
To stop the app, press
Ctrl+C
or run:docker-compose down
# Use official Python image
FROM python:3.10-slim
# Set working directory inside container
WORKDIR /app
# Copy your project files
COPY . /app
# Install dependencies
RUN pip install --upgrade pip
RUN pip install -r requirements.txt
# Expose the port Flask runs on
EXPOSE 5000
# Run your app
CMD ["python", "app.py"]
Generate it with:
pip freeze > requirements.txt
✅ This should include things like:
Flask
Flask-Admin
Flask-Login
Flask-SQLAlchemy
Flask-CKEditor
Flask-Babel
venv/
__pycache__/
*.pyc
*.db
.env
From the root of your project (where Dockerfile
lives):
docker build -t flask-cms .
docker run -d -p 5000:5000 flask-cms
Then open your browser:
To save your cms.db
outside the container:
docker run -d -p 5000:5000 \
-v $(pwd)/cms.db:/app/cms.db \
flask-cms
If you want to add a database like PostgreSQL later, use docker-compose.yml
. I can provide that too.
Task | Command |
---|---|
Build image | docker build -t flask-cms . |
Run app | docker run -p 5000:5000 flask-cms |
View app | http://localhost:5000 |