I am trying to set up litefs but am facing some confusion after looking at examples and reading the docs, and want to verify my setup with someone more experienced.
- in my fly.toml my app is listening on 5019 with ports 80/443 exposed to the world.
- In my docker file I previously had 5019 exposed. I think I am now to remove that? And litefs proxy will be the “exposed” port via litefs.yaml?
- In litefs.yaml, I think the addr is the lifefs proxy port so I can set it to any port port that does not conflict with something in my fly.toml? Here i hae set it to 8080 for example
- target is my app at “localhost:5019”?
Are these settings correct? Thanks.
fly.toml
[[services]]
internal_port = 5019
...
[[services.ports]]
handlers = ["http"]
port = 80
force_https = true
[[services.ports]]
handlers = ["tls", "http"]
port = 443
Docker file
...
ENV APPLICATION_PORT=5019
ENV LITEFS_PROXY_PORT=8080
...
# EXPOSE 5019
ENTRYPOINT ["litefs", "mount"]
litefs.yaml
proxy:
addr: ":${LITEFS_PROXY_PORT}" # LiteFS listens on addr and proxies to target
target: "localhost:${APPLICATION_PORT}"
db: "${DATABASE_FILENAME}"