63 lines
1.0 KiB
Markdown
63 lines
1.0 KiB
Markdown
|
|
# zqyy-dockerfile
|
||
|
|
|
||
|
|
This repository keeps Dockerfiles under each image directory and uses one root
|
||
|
|
`docker-compose.yml` as the unified build/run entrypoint.
|
||
|
|
|
||
|
|
## Layout
|
||
|
|
|
||
|
|
```text
|
||
|
|
docker-compose.yml
|
||
|
|
src/
|
||
|
|
zqyy/
|
||
|
|
elasticsearch/
|
||
|
|
Dockerfile
|
||
|
|
config/
|
||
|
|
dictionaries/
|
||
|
|
README.md
|
||
|
|
test-hanlp.sh
|
||
|
|
```
|
||
|
|
|
||
|
|
## Build Images
|
||
|
|
|
||
|
|
Build one image:
|
||
|
|
|
||
|
|
```bash
|
||
|
|
docker compose build elasticsearch-hanlp
|
||
|
|
```
|
||
|
|
|
||
|
|
Build all images defined in the root compose file:
|
||
|
|
|
||
|
|
```bash
|
||
|
|
docker compose build
|
||
|
|
```
|
||
|
|
|
||
|
|
## Run Services
|
||
|
|
|
||
|
|
Run one service:
|
||
|
|
|
||
|
|
```bash
|
||
|
|
docker compose up -d elasticsearch-hanlp
|
||
|
|
```
|
||
|
|
|
||
|
|
Run all services:
|
||
|
|
|
||
|
|
```bash
|
||
|
|
docker compose up -d
|
||
|
|
```
|
||
|
|
|
||
|
|
## Add A New Image
|
||
|
|
|
||
|
|
1. Create a new image directory under `src/zqyy/<image-name>/`.
|
||
|
|
2. Put that image's `Dockerfile` and related files in the image directory.
|
||
|
|
3. Add a service in the root `docker-compose.yml`.
|
||
|
|
4. Set `build.context` to the image directory, for example:
|
||
|
|
|
||
|
|
```yaml
|
||
|
|
services:
|
||
|
|
example:
|
||
|
|
image: zqyy/example:latest
|
||
|
|
build:
|
||
|
|
context: ./src/zqyy/example
|
||
|
|
dockerfile: Dockerfile
|
||
|
|
```
|