radupotop / ships-api

Polestar coding challenge

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Each part of the app runs in a separate Docker container orchestrated using docker-compose.

  • db
  • app
  • setup

The setup is intended to run only once.

The tests are the only exception, they run inside a venv.

Building and running

The setup container is only meant to be run once when initially creating the db and loading the csv.

docker-compose build
docker-compose up -d db
docker-compose up -d setup # only run once
docker-compose up -d app

The running app can be found at http://localhost:8000/

The API can be found at:

Running Tests

The tests need the db container to be up. These two commands need to be done before running the tests:

docker-compose build # if not already built
docker-compose up -d db

And then:

cd app
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
python test.py

About

Polestar coding challenge


Languages

Language:HTML 53.2%Language:Python 43.3%Language:Dockerfile 3.6%