Skip to content

Commit def65ba

Browse files
authored
Merge pull request #43 from jaredwray/feat-adding-in-docker-compose-example
feat: adding in docker compose example
2 parents b7ebd77 + 1c06e4f commit def65ba

File tree

3 files changed

+33
-1
lines changed

3 files changed

+33
-1
lines changed

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,29 @@ A simple HTTP server that can be used to mock HTTP responses for testing purpose
2424
docker run -d -p 3000:3000 jaredwray/mockhttp
2525
```
2626

27+
# Deploy via Docker Compose
28+
```yaml
29+
services:
30+
mockhttp:
31+
image: jaredwray/mockhttp:latest
32+
ports:
33+
- "3000:3000"
34+
```
35+
36+
If you want to run it on a different port, just change the `3000` to whatever port you want and add in the environment variable `PORT` to the environment.
37+
38+
```yaml
39+
services:
40+
mockhttp:
41+
image: jaredwray/mockhttp:latest
42+
ports:
43+
- "3001:3001"
44+
environment:
45+
- PORT=3001
46+
```
47+
48+
You can see an example of this in the [docker-compose.yaml](docker-compose.yaml) file.
49+
2750
# Deploy via NodeJS
2851
```bash
2952
npm install @jaredwray/mockhttp --save

docker-compose.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
services:
2+
mockhttp:
3+
image: jaredwray/mockhttp:latest
4+
ports:
5+
- "3001:3001"
6+
environment:
7+
- PORT=3001

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@jaredwray/mockhttp",
3-
"version": "0.4.1",
3+
"version": "0.4.2",
44
"description": "Mock Http - Easy way to mock http with httpbin replacement",
55
"type": "module",
66
"main": "dist/index.js",
@@ -16,6 +16,8 @@
1616
"docker:push": "docker push jaredwray/mockhttp",
1717
"docker:stop": "docker stop $(docker ps -a -q --filter ancestor=jaredwray/mockhttp --format=\"{{.ID}}\")",
1818
"docker:readme": "tsx ./scripts/create-docker-readme.ts",
19+
"docker:compose:up": "docker-compose up -d",
20+
"docker:compose:down": "docker-compose down",
1921
"prepare": "pnpm build",
2022
"start": "node dist/index.js"
2123
},

0 commit comments

Comments
 (0)