[Q108] Quest System Containerization
🥇3000 EGP
1st Place
🥈1000 EGP
2nd Place
🙋♀️ Register before:
Sunday, February 11th
📦 Submit before:
Sunday, February 18th
Quest Submission APIs
Overview
In order to give a seamless testing and development experience, we want to dockerize and create a simple docker-compose file to allow anyone to launch and test the code-quests platform on their machine without having to install anything but docker.
System Architecture
Given the following system architecture, we need to dockerize 2 services
Dockerize the backend and frontend
Code-Quests Backend Node Application
Automatically builds the dockerfile with the backend code and runs it using node command. (no web server needed)
https://github.com/code-quests/code-quests
Code-Quests-Web React Application, served with nginx or any lightweight web server
Automatically builds the dockerfile with the frontend code and serve it using nginx
https://github.com/code-quests/code-quests-web
The frontend must utilize a multistage docker build to make it small in size, build using a node image, then run using an nginx image.
Refer to multi-stage build here https://docs.docker.com/build/building/multi-stage/
Docker compose
To allow any developer to build, and test the application without downloading any dependencies, build a docker compose that will run the whole system on docker.
Your docker compose should include the following services:
Mailhog to act as an SMTP server with a dashboard to view the emails
https://hub.docker.com/r/mailhog/mailhogPostgresql Database
Pre-initialized with an empty code-quests-db and a user so the application can connect to itCode-Quests backend (built directly using the dockerfile, do not upload to dockerhub!) check the build specification here: https://docs.docker.com/compose/compose-file/build/
Code-Quests-web frontend app, (built directly using the dockerfile, do not upload to dockerhub!)
Note:
send us your github username on the quest whatsapp group so we can give you access to the repositories above.
You will be able to fork privately the repos in order to test the github actions.
CI/CD Pipeline for Backend and Frontend repos
Build a github actions pipeline that will execute the following:
Install dependencies (npm ci)
Lint and Test (npm run lint && npm run test) if provided in the packages.json
Build the code (npm run build)
Upload the generated ./dist (or ./build) folder to an FTP server using credentials in Github repo secrets
Do not declare the secrets or the FTP server credentials or paths directly in the script, instead use them as variables.
Note: we will provide FTP server for testing privately
Acceptance Criteria
Upload a Video showing the compose file building and the frontend and backend being served correctly.
No hard-coded parameters, everything uses environment variables.
Your submission should include the following:
The video requested above
A README.md explaining how the files work
Dockerfiles for both frontend and backend
Docker-compose.yaml
Github action yaml files for both repos.
Quest Ended
📈 Challenge Statistics
🙋♀️Registrations: 12
📦 Submissions: 0
Updated every night