PMPL Sprint 2 — Dockerizing DIGIPUS Application


Background #1

Dependencies, Dependencies…

  • A mass collection of Python libraries that are needed to be installed first, including Django and other useful libraries. This can be solved immediately by using a Python virtual environment. But given the sheer amount of libraries, there’s no guarantee that installation process could be completed in one go. Some packages may require another dependency in a form of OS library and that is beyond the scope of Python itself. In other words, this could potentially bring problems when we try to install this project’s dependencies on different platforms.
  • A database. By default, running this project without configuring anything related to database will result the use of SQLite3. Although it is usable in development, still, we should try making our development environment as closely as possible to the staging or production environment. And that is by providing an installed PostgreSQL database on the host, as originally intended by the original project contributors. However, it implies that we need to have a PostgreSQL installed to our host. Sadly, the process of installing PostgreSQL can be quite cumbersome.

Action #1

Dockerizing the Application for Use in Development

  • Faster installation.
  • Avoids using , which potentially could cause arbitrary code execution during installation.
  • No compiler required on the host OS for installing packages which are extensions of C.
  • Provides better caching for testing and Continuous Integration process.
  • More consistent installation process across platforms and machines.
  • Standardized installation across platforms and machines. Just provide the required environment variables, run docker-compose up -d --build and we’re good to go.
  • Minimize the extra steps needed in installing compilers for certain Python packages and PostgreSQL to our host OS.
  • A good start for deploying the application to a production server in a containerized manner.

Background #2

The Time-Consuming Continuous Integration Process

Before: Time-consuming CI in “peak” times.

Action #2

Custom Docker Image to Simplify the Continuous Integration Process

After: Using digipus-base image
The duration for the last 30 commits duration, relative to the times of writing this article





Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

How to Integrate Twilio in Django

Ruby, config this

Introduction to Timeline in Unity

How I supercharged my microservices workflow with Alfred ⚡

A cat frantically typing on a laptop keyboard

What’s Going On Behind the Screens: Ergo Weekly Dev Update August 4th

Securing Semi-Structured Data with Peacemakr

Why we chose Java for our High-Frequency Trading application

Controlling light from telegram bot

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Farhan Azmi

Farhan Azmi

More from Medium

Connecting your GitHub Account To dbt

Project MaeCon — All About Us

The Most Important Event Planning Steps — Step One.

Housing, commuting, and grocery shopping in Va-Hi without a car