Skip to content

Commit

Permalink
add host ip env in docker file
Browse files Browse the repository at this point in the history
  • Loading branch information
robatipoor committed Mar 17, 2024
1 parent acaf66c commit 7cfbe91
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,10 @@ $ cargo run --bin api
$ docker build -t pf-api:latest -f api/Dockerfile .

# Run Docker container on address 0.0.0.0:8080
$ docker run --name pf-api --rm -p 8080:8080 \
-e PF__SERVER__HOST='0.0.0.0' -d pf-api:latest
$ docker run --name pf-api --rm -p 8080:8080 -d pf-api:latest

# Alternatively, you can pull the image from the github registry and run container
$ docker run --name pf-api --rm -p 8080:8080 \
-e PF__SERVER__HOST='0.0.0.0' -d ghcr.io/robatipoor/pf-api:latest
$ docker run --name pf-api --rm -p 8080:8080 -d ghcr.io/robatipoor/pf-api:latest
```

**How to Use**
Expand Down
1 change: 1 addition & 0 deletions api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ COPY --from=builder /workspace/target/release/api .
EXPOSE 8080

ENV RUST_LOG info
ENV PF__SERVER__HOST '0.0.0.0'

# run the binary
ENTRYPOINT ["./api","--settings","settings/base.toml"]

0 comments on commit 7cfbe91

Please sign in to comment.