0% found this document useful (0 votes)
8 views10 pages

Docker Project: RESTful API Setup

The document outlines a Docker project for CPSY 300, focusing on building a web application with database integration and deploying it using Docker. It details the objectives, mandatory steps for Part 1, and final submission requirements, including code snippets, screenshots, and a video explanation. The project aims to enhance skills in Docker, programming, database management, and operating system concepts.

Uploaded by

ABEEL GAMING
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)
8 views10 pages

Docker Project: RESTful API Setup

The document outlines a Docker project for CPSY 300, focusing on building a web application with database integration and deploying it using Docker. It details the objectives, mandatory steps for Part 1, and final submission requirements, including code snippets, screenshots, and a video explanation. The project aims to enhance skills in Docker, programming, database management, and operating system concepts.

Uploaded by

ABEEL GAMING
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

CPSY 300

Operating Systems

Docker Project: Part 1 out of 4 Parts

Weight: 12.5% Marks: /100

Student Name:

Student ID:

Date:
This page was intentionally left blank.
Table of Contents
Docker Project ............................................................................................................................2

Introduction ............................................................................................................................ 2

Equipment and Materials ........................................................................................................ 2

Objectives .............................................................................................................................. 2

Deploying a RESTful API with Database Integration, Managed as a Process Using Docker .. 3

Overview ............................................................................................................................. 3
Mandatory steps (Part 1 in your PDF) ................................................................................. 3
Mandatory steps (Part 2 in your PDF) ................................................................................. 5
Final Submission Requirements ............................................................................................. 7

Marking Criteria ...................................................................................................................... 8

© 2022, Southern Alberta Institute of Technology i


Docker Project
Introduction
In this project, you will build a web application using any programming language of your choice
(e.g., Python, [Link], Ruby, Java, C#, etc.). You’ll connect it to a database (e.g., MySQL,
PostgreSQL, MongoDB, etc.) and deploy it using Docker on your local machine. Along the way,
you'll also learn about key operating system concepts like process management, CPU scheduling,
memory management, and file systems. The whole project is divided into four parts. Hereafter is
Part 1 out of 4 Parts.

Equipment and Materials


• Framework for the language of your choice (Python, .NET Framework, Java, etc.)
• Docker.
• Database (MySQL, PostgreSQL, MongoDB, etc.)

Objectives
Upon completing this project, you will have achieved the following objectives:
• Docker: Learn how to package and run apps in isolated containers.
• Programming language: Build a web app using any language you choose.
• RESTful services: Understand how to create web apps and small services.
• Database: Build a web app that works with a database.
• Cloud integration: See how traditional OS concepts work in modern cloud environments
(Part 2, etc.).
• Docker skills: Get hands-on experience with Docker, a popular tool for easy app
deployment.
• Programming languages and frameworks: Learn important skills in programming and
frameworks, needed to build big applications.
• Database management: Understand how apps interact with databases to create reliable
software.
• DevOps practices: Learn basic DevOps skills like containerization and app deployment,
essential in today’s tech industry.
• Operating system knowledge: Understand how the OS manages processes (Part 1),
CPU scheduling (Part 2), memory (Part 3), and file system (Part 4) to improve app
performance in containers and cloud setups.

© 2022, Southern Alberta Institute of Technology 2


Project Part 1 (of 4)

Deploying a RESTful API with Database Integration, Managed


as a Process Using Docker
Overview
This project-part-assignment guides and offers a detailed walkthrough for developing a RESTful
API connecting with a database, deploying it with Docker, and managing Docker containers as
processes—specifically through creation, termination, and signalling—within a Windows 10,
Windows 11 or Windows 10 VM, built in the first lab. To ensure thoroughness and clarity, you
include all relevant screenshots and details in your submission. Such screenshots must be high
resolution and must include what is asked to be eligible for marks. Compile your final submission
into a single PDF file.

Mandatory steps (Part 1 in your PDF)


• Code content includes the following code snippets (20 marks):
o Provide the code for the application including endpoints and database connection
as well as handling exceptions for common errors.

Your code here

o Include the Dockerfile configurations used to create the Docker image.

Your code here

o List the dependencies required for the application (e.g., [Link]).

Your code here

• Compile and execute code (10 marks). Steps:


o Install all dependencies locally and take a screenshot(s) of the successful
installation.

Your screenshot(s) here

© 2022, Southern Alberta Institute of Technology 3


o Run the application locally to verify that it works as expected and take
screenshot(s).

Your screenshot(s) here

• Deploy code on docker (10 marks). Steps:


o Create a Docker image using the Dockerfile (docker build -t …) and take
screenshot(s) of the successful image creation.

Your screenshot(s) here

o Run the Docker container with port mapping from the image created (docker
run -d -p …) and take screenshot(s).

Your screenshot(s) here

• Connect to DB Docker container (10 marks). Steps:


o Run a database container if not included in the main Docker image as a separate
container and take screenshot(s) of the database container running.

Your screenshot(s) here

o Connect to the database using CLI tools or GUI applications and take
screenshot(s) of the successful connection to the database.

Your screenshot(s) here

• Select records from DB Docker container (10 marks). Steps:


o Access the database using the Docker CLI (docker exec -it db …) and take
screenshot(s).

Your screenshot(s) here

o Run a query to retrieve records (SELECT * FROM … ) and take screenshot(s)


showing student records.

Your screenshot(s) here

© 2022, Southern Alberta Institute of Technology 4


• Postman screenshots (20 marks). Steps:
o POST request for creating a student record and take screenshot(s) in each step:
 Set up a POST request in Postman to create a student record.
 URL: [Link]
 Method: POST
 Body: Provide JSON payload for the request, sample input JSON:
{
"studentID": "Your student ID",
"studentName": "Your full name",
"course": "OS",
"presentDate": "current date"
}

o Expected response: HTTP status code 201 created, message student


created successfully. Take a screenshot showing that expectation plus the
current date, your student ID, and your name, provided in JSON.

Your screenshot(s) here

o POST request for testing and handling the existing records and take a
screenshot(s) such that use the same endpoint with identical data to test the
handling of existing records.
o Expected response: HTTP status code 409 conflict, message student already
exists. Take a screenshot showing that.

Your screenshot(s) here

Mandatory steps (Part 2 in your PDF)


• Assign a name to the container, start the Docker container in detached mode and take
a screenshot (4 marks).

Your screenshot(s) here

• Monitoring Docker containers (4 marks):


o Using Docker CLI:
 List running containers (docker ps) and take screenshot(s) of the output.

© 2022, Southern Alberta Institute of Technology 5


Your screenshot(s) here

 View logs and take screenshot(s) of the logging output.

Your screenshot(s) here

o Using Windows Task Manager:


 Open Task Manager (CTRL+ Shift + ESC) and then monitor the Docker
processes under the Processes tab and take screenshot(s) showing
Docker process.

Your screenshot(s) here

• Terminate Docker container (4 marks):


o Using Docker CLI:
 Stop the container and take screenshot(s) confirming that the container
has stopped.

Your screenshot(s) here

 Remove the container and take screenshot(s) confirming container


removal.

Your screenshot(s) here

o Using Windows Task Manager:


 Find the Docker process, end it and take screenshot(s) showing Docker
process termination.

Your screenshot(s) here

• Signaling Docker container (5 marks). Graceful shutdown:

© 2022, Southern Alberta Institute of Technology 6


o Stop the container with a Docker command and take screenshot(s) showing
graceful shutdown.

Your screenshot(s) here

o Repeat the above step to force shutdown in that time and take screenshot(s)
showing force shutdown.

Your screenshot(s) here

• Quick monitoring and troubleshooting (5 marks):


o Monitor resource usage using a Docker command and take screenshot(s)
showing resource usage statistics.

Your screenshot(s) here

o Inspect container state using Docker command (docker inspect …) and take
screenshot(s) of inspection output.

Your screenshot(s) here

o Check and view logs for issues using the necessary Docker command and take
screenshot(s) of output.

Your screenshot(s) here

Final Submission Requirements


You should include the following items in a single ZIP folder:
• PDF Document:
o Compile all screenshots and all code snippets into one comprehensive PDF file.
o Ensure that all screenshots are high-resolution, with clear and readable text that
meets the criteria for eligible marks.
• Video Explanation:

© 2022, Southern Alberta Institute of Technology 7


o Record a brief video explaining each screenshot, ensuring your face is visible for
a personal touch. Use platforms such as Microsoft Teams or other similar tools,
but avoid uploading the video to YouTube.
• References:
o List all references used in this assignment.

Marking Criteria
Item Marks
Code content (App and Dockerfile) /10
Compile and execute code /10
Deploy code on Docker /10
Connect to DB Docker container /10
Select records from the DB in the container /10
Postman screenshots /10
Managing Docker containers on Windows 10 /22
A short video /5
References /3
Total Marks /100

© 2022, Southern Alberta Institute of Technology 8

You might also like