chore: Docker commands

This commit is contained in:
Vjacheslav Trushkin 2023-01-08 13:46:52 +02:00
parent 624b63deb8
commit 8be5f675e5
2 changed files with 15 additions and 1 deletions

View File

@ -14,6 +14,15 @@ If you want to customise config, fork this repo, customise source code, then bui
To run a Docker image, run `docker run -d -p 3000:3000 iconify/api` (change first 3000 to port you want to run API on).
NPM commands for working with Docker images:
- `npm run docker:build` - builds Docker image.
- `npm run docker:start` - starts Docker container on port 3000.
- `npm run docker:stop` - stops all Iconify API Docker containers.
- `npm run docker:cleanup` - removes all unused Iconify API Docker containers.
There is no command to remove unused images because of Docker limitations. You need to do it manually from Docker Desktop or command line.
## How to use it
First, you need to install NPM dependencies and run build script:

View File

@ -18,7 +18,12 @@
"scripts": {
"build": "tsc -b",
"test": "vitest --config vitest.config.mjs",
"start": "node --expose-gc lib/index.js"
"start": "node --expose-gc lib/index.js",
"docker:build": "./docker.sh",
"docker:start": "docker run -d -p 3000:3000 iconify/api",
"docker:stop": "docker ps -q --filter ancestor=iconify/api | xargs -r docker stop",
"docker:cleanup": "docker ps -q -a --filter ancestor=iconify/api | xargs -r docker rm",
"docker:publish": "docker push iconify/api"
},
"dependencies": {
"@fastify/formbody": "^7.4.0",