Skip to content

Commit

Permalink
Containerize a web app with docker-compose
Browse files Browse the repository at this point in the history
  • Loading branch information
SagarGi committed Sep 6, 2023
1 parent 9d4cee7 commit 4b857e8
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions src/assets/DockerCompose/docker_compose.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
title: Containerize a Web Application using docker compose
authorName: Sagar Gurung
authorAvatar: https://avatars.githubusercontent.com/u/46086950?v=4
authorLink: https://github.com/SagarGi
createdAt: Aug 31, 2023
tags: docker-compose, docker, containerization,yaml
banner: https://raw.githubusercontent.com/DevExpress/testcafe-gh-page-assets/master/src/images/testcafe-ogp-icon.png
---

In this blog we will basically be containerizing a web application consisting of `MySQL`, `phpmyadmin`, `frontend` and `backend` as service using docker compose.
> Note: This article does not provide concepts of docker. If you like to know concepts of docker [visit here.](https://blog.jankaritech.com/#/blog/How%20to%20use%20selenium%20in%20docker%3F)
Setting up an application can be a bit hefty if application is dependent to various services when setting up locally. But we can easily configure and containerize the whole application and its services in a single docker compose file and make the whole application running not only in your machine but in whole development environment.
In this blog we will make a basic `docker-compose.yaml` for a simple demo project to make it run through the `yaml` file in your machine. So lets get right into it.

## Prerequisites
since we will be setting up a whole demo application locally first and also with docker compose file, the followings should be installed into your system before we start.
- [Node.js](https://nodejs.org/en) version 16 or above.
- MYSQL
- [Docker](https://docs.docker.com/engine/install/)
- And [docker compose](https://docs.docker.com/compose/install/)

> Note: For this blog the whole setup is done in ubuntu 22.04 LTS
## Setting up wep application locally
Before we begin to write and set up the docker compose file, lets set up the demo web application locally in your machine.
I have a web application which has frontend `demo-web` and backend `demo-server` in `github` publicly available.

1. **Setting up frontend**

Please follow the following steps to set up the `frontend` in your local machine
2. **Setting up database MYSQL**
3. **Setting up backend**

0 comments on commit 4b857e8

Please sign in to comment.