mirror of
https://github.com/ION606/learn.git
synced 2026-06-05 22:46:14 +00:00
initial commit
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
# Docker Compose
|
||||
allows running of multiple containers/volumes
|
||||
|
||||
|
||||
## Creating
|
||||
create a `docker-compose.yaml` file in the root dir of the project
|
||||
|
||||
|
||||
## Running
|
||||
use `docker-compose up`
|
||||
|
||||
|
||||
## Sections
|
||||
|
||||
### Version
|
||||
a version number (i.e. `version: '3'`)
|
||||
|
||||
### services
|
||||
this is the section containing the different things you want to run
|
||||
for example, if you want to runa web app, and then sql db you would use:
|
||||
```dockerfile
|
||||
services:
|
||||
web:
|
||||
build: .
|
||||
ports:
|
||||
- "3000:3000"
|
||||
db:
|
||||
image: "mysql"
|
||||
environment:
|
||||
# env vars here
|
||||
ROOT_PASS: password
|
||||
volumes:
|
||||
-db-data:/foo
|
||||
|
||||
volumes:
|
||||
-db-data:/foo
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user