feat: describe work with docker-compose
This commit is contained in:
parent
ea859546ee
commit
2142c88a7c
36
README.md
36
README.md
@ -67,3 +67,39 @@ docker run -d --name golang-app --security-opt="apparmor=unconfined" --cap-add=S
|
|||||||
2. Build docker container with debugger.
|
2. Build docker container with debugger.
|
||||||
3. Run container on docker with debugger.
|
3. Run container on docker with debugger.
|
||||||
4. Play debug configuration names as "debug remote docker container".
|
4. Play debug configuration names as "debug remote docker container".
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Build, run and debug application with docker-compose
|
||||||
|
|
||||||
|
#### Create environment file for docker
|
||||||
|
Create and fill environment file from template `.env.dist`
|
||||||
|
``` shell
|
||||||
|
cp configs/.env.dist .env.docker
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Build docker container
|
||||||
|
Build container
|
||||||
|
``` shell
|
||||||
|
docker build . -t psssix/golang-app:latest
|
||||||
|
```
|
||||||
|
and container with debugger
|
||||||
|
``` shell
|
||||||
|
docker build . -f Debug.Dockerfile -t psssix/golang-app:debug
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Run docker container
|
||||||
|
Run container on docker
|
||||||
|
``` shell
|
||||||
|
docker up -d --env-file .env.docker
|
||||||
|
```
|
||||||
|
and container with debugger
|
||||||
|
``` shell
|
||||||
|
docker up -d --env-file .env.docker -f docker-compose-debug.yml
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Debug docker container
|
||||||
|
1. Create and fill `.env.docker` file by template `.env.dist`.
|
||||||
|
2. Build docker container with debugger.
|
||||||
|
3. Run container on docker with debugger.
|
||||||
|
4. Play debug configuration names as "debug remote docker container".
|
||||||
Loading…
x
Reference in New Issue
Block a user