Phase: Ended
Registration Deadline: February 11, 2024
Submission Deadline: February 18, 2024
1 Place
2 Place
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.
Given the following system architecture, we need to dockerize 2 services
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/
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/mailhog
Postgresql Database
Pre-initialized with an empty code-quests-db and a user so the application can connect to it
Code-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.
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
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.