Skip to content

nicolabio/sw-assignment-py

Repository files navigation

Python App with MinIO using Docker Compose

The project contains a bucket printer. It prints items in the MiNIO bucket. There are two types of printers: StdoutPrinter and JsonPrinter. The environment variable SW_ASSIGNMENT_MODE is to set the printer type.

The Python application uses Poetry for dependency management.

This project sets up a Python application with MinIO using Docker Compose. The files in minio_data are mounted to the MinIO container. See the docker-compose.yml.

Prerequisites

  • Docker
  • Docker Compose
  • Python 3.9.18
  • Poetry
  • Taskfile

Setup

  1. Run the installation script to set up the required dependencies:

    ./install_dependencies.sh

    This script will install Python 3.9.18, Taskfile, pipx, Poetry, and set up the Poetry environment.

  2. Verify the project setup:

    task all

    This command will run all tasks, including formatting, linting, testing, building the Docker image, and running the Docker Compose setup.

Project Structure

  • sw_assignment/: Main Python package
  • tests/: Test files
  • Dockerfile: Docker configuration for the Python app
  • docker-compose.yml: Docker Compose configuration
  • Taskfile.yml: Task runner configuration
  • pyproject.toml: Poetry project configuration

Usage

To run the application:

task up

To view the logs:

task logs

To stop the application:

task down

To run all together:

task run

Development

  • Use task format to run all formatters
  • Use task lint to run all linters
  • Use task test to run all tests
  • Use task dev to run the formatters, linters, and tests

For more detailed task information, refer to the Taskfile.yml.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •