This is a simple Pastebin application built with Flask, containerized using Docker and orchestrated with Docker Compose.
Clone the Repository:
git clone <repository_url>
cd <repository_directory>
Create a .env_file
:
Ensure you have a .env_file
in the project root with the necessary environment variables. Example:
FLASK_APP=pastebin
FLASK_DEBUG=True
SECRET_KEY=your_secret_key
An example file is also available for demonstration purposes, .env_file_example
. Flask debug, True for dev and False for otherwise.
Build and Start the Application:
docker-compose up --build
This command builds the Docker image and starts the Pastebin service. The application will be accessible at http://localhost:5000.
Stopping the Application:
Press Ctrl+C
in the terminal where docker-compose
is running, then execute:
docker-compose down
If you prefer to run the application without Docker, follow these steps:
Install Python 3.
Install virtualenv
:
pip install virtualenv
Create and Activate a Virtual Environment:
virtualenv venv
source venv/bin/activate
On Windows, run:
.venv\Scripts\activate
Install the Required Dependencies:
pip install -r requirements.txt
Set Environment Variables from .env_file
:
export $(cat .env_file | xargs)
Run the Flask Application:
flask --env-file .env_file run
To start the application with Docker Compose:
docker-compose up
Please see CONTRIBUTING.md for guidelines on how to contribute to this project.
For more details on secure coding practices, please refer to the OWASP Developer Guide and SECURITY.md.