Skip to content

Latest commit

 

History

History
47 lines (35 loc) · 1.27 KB

README.md

File metadata and controls

47 lines (35 loc) · 1.27 KB

Docker app demo

Demo application development with docker. This repository is the source code for my blog post Developer hiện đại phần 2: Chạy ứng dụng trên... localhost

How to use

It's easy, just follow these steps:

Clone this repository:

$ git clone https://github.com/minhpq331/docker-app-demo.git
$ cd docker-app-demo

Make environment file, change your compose project name and put your uid and gid in

$ cp .env.example .env
$ echo $(id -u):$(id -g)
1000:1000
# This is your uid and gid, copy all this line and paste it in .env file

Install dependencies

$ script/compose_run.sh yarn

Start docker compose

$ docker-compose up

To stop running, press <Ctrl> + <C>

Useful commands

If you need to run any command with yarn, npm,... try this but remember to change your service name in script/compose_run.sh file:

$ script/compose_run.sh <your command>

After changing Dockerfile, please run this command:

$ docker-compose build

After changing your code, please stop your app with <Ctrl> + <C> and start over with docker-compose up. This behavior will be improved in my next blog.