Skip to content

Commit

Permalink
🔧 Set HEAVY_MOCK_CONFIG default value to /etc/heavy-mock/config.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
heavynimbus committed Jul 8, 2024
1 parent 69cdf76 commit a67bcee
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 13 deletions.
9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ endpoints:
### 🐳 Docker Compose
*The following example uses the configuration file `basic-example.yml` from the [examples](./examples) directory,
if you want to use another configuration file, you need to change the `HEAVY_MOCK_CONFIG` environment variable
and make sure that the file is in the `/configs` directory bound to the container*
if you want to use another configuration file, you must change the `source` field in the `volumes` section*

```yaml
version: '3.8'
Expand All @@ -71,11 +70,9 @@ services:
image: heavynimbus/heavy-mock-http-server:0.0.1
ports:
- "8080:80"
environment:
- HEAVY_MOCK_CONFIG=/configs/single-endpoint.yml # The configuration file that the server should use
volumes:
- type: bind
source: ./examples
target: /configs
source: ./examples/single-endpoint.yml
target: /etc/heavy-mock/config.yml
read_only: true
```
7 changes: 2 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,8 @@ services:
dockerfile: Dockerfile
ports:
- "8080:80"
environment:
- HEAVY_MOCK_CONFIG=/configs/single-endpoint.yml
volumes:
- type: bind
source: ./examples
target: /configs
source: ./examples/single-endpoint.yml
target: /etc/heavy-mock/config.yml
read_only: true

2 changes: 1 addition & 1 deletion server/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ spring:

heavy:
mock:
config: ${HEAVY_MOCK_CONFIG}
config: ${HEAVY_MOCK_CONFIG:/etc/heavy-mock/config.yml}
2 changes: 1 addition & 1 deletion server/src/main/resources/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
<appender-ref ref="STDOUT"/>
</root>

<logger name="heavynimbus.server" level="debug"/>
<logger name="heavynimbus.server" level="info"/>
</configuration>

0 comments on commit a67bcee

Please sign in to comment.