Skip to content
This repository was archived by the owner on Dec 25, 2024. It is now read-only.

CSGY-9223-Group3/lab1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

938f0a5 · Nov 17, 2024
Nov 15, 2024
Sep 28, 2024
Sep 29, 2024
Oct 15, 2024
Sep 29, 2024
Nov 15, 2024
Sep 21, 2024
Sep 28, 2024
Nov 15, 2024
Nov 15, 2024
Nov 15, 2024
Sep 29, 2024
Sep 29, 2024
Oct 18, 2024
Oct 16, 2024
Oct 16, 2024

Repository files navigation

Lab 1: Pastebin Application

This is a simple Pastebin application built with Flask, containerized using Docker and orchestrated with Docker Compose.

Prerequisites

Setup and Running the Application

Using Docker Compose

  1. Clone the Repository:

    git clone <repository_url>
    cd <repository_directory>
  2. 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.

  3. 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.

  4. Stopping the Application:

    Press Ctrl+C in the terminal where docker-compose is running, then execute:

    docker-compose down

Without Docker (Optional)

If you prefer to run the application without Docker, follow these steps:

  1. Install Python 3.

  2. Install virtualenv:

    pip install virtualenv
  3. Create and Activate a Virtual Environment:

    virtualenv venv
    source venv/bin/activate

    On Windows, run:

    .venv\Scripts\activate
  4. Install Pipenv dependency manager

    pip install pipenv
  5. Install the Required Dependencies:

    pipenv install
  6. Set Environment Variables from .env_file:

    export $(cat .env_file | xargs)
  7. Run the Flask Application:

    flask --env-file .env_file run

Running the Application

Using Docker Compose

To start the application with Docker Compose:

docker-compose up

Contributing

Please see CONTRIBUTING.md for guidelines on how to contribute to this project.

Security

For more details on secure coding practices, please refer to the OWASP Developer Guide and SECURITY.md.

Additional Documentation