Skip to content

Commit

Permalink
chore(): make docker-compose use env vars from .env
Browse files Browse the repository at this point in the history
  • Loading branch information
piyook committed May 21, 2024
1 parent eb493fb commit 024aaec
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ To create a new api path (E.g api/users)
### Change api url prefix

By default the api paths with be prefixed with "api/" this can be modified with the
USE_API_URL_PREFIX environment variable.
USE_API_URL_PREFIX environment variable in the .env file.

By setting this to blank then the path will just be the api name E.g localhost:8000/users

Expand All @@ -154,11 +154,9 @@ USE_API_URL_PREFIX=things

will give localhost:8000/things/users

**Note**: This value needs to be changed in the .env file when running directly on a local machine and in the docker-compose.yaml file for running in docker containers.

### Change port number

By default this is set to 8000 but can be changed by setting the SERVER_PORT in the .env or docker-compose.yaml file:
By default this is set to 8000 but can be changed by setting the SERVER_PORT in the .env file:

```
SERVER_PORT=1234
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ services:
environment:
NODE_ENV: development
HUSKY: 0
SERVER_PORT: 8000
USE_API_URL_PREFIX: api
SERVER_PORT: ${SERVER_PORT}
USE_API_URL_PREFIX: ${USE_API_URL_PREFIX}
ports:
- 8000:8000

0 comments on commit 024aaec

Please sign in to comment.