I have the following fastify app which is reporting back as healthy:
However, when I utilise flyctl open
or navigate to either the hostname or IP address, I am seeing a " vega.fly.dev unexpectedly closed the connection." message on https?
My Dockerfile is as follows:
# FROM latest node image https://hub.docker.com/_/node/
FROM node:latest
# Create and set app directory
RUN mkdir -p /usr/src/
WORKDIR /usr/src/app/
# Prefer not to run as root.
USER node
# Give ownership to the node user:
USER root
RUN chown -R node /usr/src/app/
RUN corepack enable
USER node
COPY --chown=node ./ /usr/src/app/
RUN yarn install
# Build for production
RUN yarn build
# Expose internal port for production
EXPOSE 8981
# Server for production
ENTRYPOINT [ "yarn" ]
CMD ["serve"]
And my fly.toml is as follows:
# fly.toml file generated for vega on 2022-06-13T16:52:46+01:00
app = "vega"
kill_signal = "SIGINT"
kill_timeout = 5
processes = []
[env]
PORT = "8080"
[experimental]
allowed_public_ports = []
auto_rollback = true
[[services]]
http_checks = []
internal_port = 8981
processes = ["app"]
protocol = "tcp"
script_checks = []
[services.concurrency]
hard_limit = 25
soft_limit = 20
type = "connections"
[[services.ports]]
force_https = true
handlers = ["http"]
port = 80
[[services.ports]]
handlers = ["tls", "http"]
port = 443
[[services.tcp_checks]]
grace_period = "1s"
interval = "15s"
restart_limit = 0
timeout = "2s"
What extra do I need to do here to get this working?