0% found this document useful (0 votes)
32 views

Code Challenge - Devops: Scenario

The document outlines requirements for a Docker Compose file to deploy an API and database in a production environment. It specifies: 1) Only nginx should be accessible to users via HTTP and HTTPS, with 3 application containers running at all time behind it. 2) The database should only be accessible to application containers. 3) An initialization script to setup the database should run once on initial provisioning in an application container. It provides additional requirements for a development setup including direct access to containers and database for easier debugging.

Uploaded by

Krishna ps
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views

Code Challenge - Devops: Scenario

The document outlines requirements for a Docker Compose file to deploy an API and database in a production environment. It specifies: 1) Only nginx should be accessible to users via HTTP and HTTPS, with 3 application containers running at all time behind it. 2) The database should only be accessible to application containers. 3) An initialization script to setup the database should run once on initial provisioning in an application container. It provides additional requirements for a development setup including direct access to containers and database for easier debugging.

Uploaded by

Krishna ps
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Code Challenge - DevOps

Scenario

Our development team has written an API to perform an airport search. We expect this API to get a high load which is why we need a more
performant (and secure) setup to expose the API. This setup should use Docker and the overall design should look like this. Your task is to
provide a docker compose file that fulfills the requirements given below.

Advice & Rules

Try to design and implement your solution as if it was a real production system.
Design the system for a high load and with fault tolerance.
Ensure the isolation of the subsystems according to the scheme given below.
It's OK to try something new (tell us if you do), but feel free to use something you're comfortable with.

Production Setup

Technical requirements

only the nginx container is accessible to users, via HTTP and HTTPS (self-signed)
3 instances of the application container have to run at all times
the database is only accessible to the application container
the application also features a initialisation script to setup the DB
this has to be run exactly once (on initial provisioning)
the PostGres container is only accessible to the APP containers

App container

For the challenge we provide an application image. It is available as a docker image from our AWS ECR. The repository can be found at: 217233
105762.dkr.ecr.eu-central-1.amazonaws.com/pxi/challenge/sandbox . The ACCESS_KEY is AKIAJRYLFB6C6YVV5I6Q the SECRET_KEY is
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.

The appliacation is configured via environment variables. The following set should be used:
DB_NAME= NAME_OF_DATABASE
DB_USER= NAME_OF_DB_USER
DB_PASS= PASSWORD_FOR_DB_USER
DB_SERVICE= HOSTNAME_OF_DB_SERVER
DB_PORT= PORT_OF_DB

Once the application is running it is available at port 5000. To setup the database the following command has to be run only once in an app
container:

python csv_import.py

Additional Task: Development setup

For use during development the dev team and the DBA also need direct access to the application containers and the DB in the most convenient
form. Please provide a description how you would change the setup or how to use the production setup to easily debug problems with the DB or
the app containers.

You might also like