Преглед изворни кода

improve docker instructions

Aneurin Barker Snook пре 11 месеци
родитељ
комит
2bea2d6cff
2 измењених фајлова са 11 додато и 0 уклоњено
  1. 3 0
      Dockerfile
  2. 8 0
      README.md

+ 3 - 0
Dockerfile

@@ -17,6 +17,9 @@ RUN go build -o shorty
 # Distribution image
 # Distribution image
 FROM debian:12
 FROM debian:12
 
 
+# Set default database path
+ENV SHORTY_DATABASE_PATH /shorty/data
+
 # Copy binary and set as command
 # Copy binary and set as command
 COPY --from=build /build/shorty /usr/local/bin/shorty
 COPY --from=build /build/shorty /usr/local/bin/shorty
 ENTRYPOINT ["shorty"]
 ENTRYPOINT ["shorty"]

+ 8 - 0
README.md

@@ -46,6 +46,14 @@ If you provide `--url|-u|SHORTY_URL` then you can use Shorty as a remote CLI. By
 
 
 Since all Shorty interaction goes through a REST API, it's easy to use another client (such as [Postman](https://www.postman.com/)) or develop your own client to manage Shorty. This is left as an exercise for the reader.
 Since all Shorty interaction goes through a REST API, it's easy to use another client (such as [Postman](https://www.postman.com/)) or develop your own client to manage Shorty. This is left as an exercise for the reader.
 
 
+## Docker usage
+
+This project is packaged as a Docker image in [GitHub Container Registry](https://github.com/annybs/shorty/pkgs/container/shorty) for ease of use.
+
+```sh
+docker run --rm -ti -v './your-data-dir:/shorty/data' -p '3000:3000' ghcr.io/annybs/shorty:develop
+```
+
 ## License
 ## License
 
 
 See [LICENSE.md](./LICENSE.md)
 See [LICENSE.md](./LICENSE.md)