I am trying to deploy a Django app to fly and I cannot get past a Failed due to unhealthy allocations
error. I am on an M1 Mac, so I’m using --remote-only
, and I have bumped the RAM up to 2GB.
The frustrating part is that I’m not seeing much in the way of errors. In the logs I see:
2022-05-28T14:30:31.428 runner[09695539] yyz [info] Starting virtual machine
2022-05-28T14:30:31.804 app[09695539] yyz [info] Starting init (commit: aa54f7d)...
2022-05-28T14:30:31.842 app[09695539] yyz [info] Preparing to run: `python3` as root
2022-05-28T14:30:31.885 app[09695539] yyz [info] 2022/05/28 14:30:31 listening on [fdaa:0:65a5:a7b:aa2:969:5539:2]:22 (DNS: [fdaa::3]:53)
2022-05-28T14:30:32.858 app[09695539] yyz [info] Main child exited normally with code: 0
2022-05-28T14:30:32.859 app[09695539] yyz [info] Starting clean up.
If anyone has any tips to at least get to a useful error output, I would be most grateful - TIA!
My Dockerfile:
FROM python:3.9
ENV PYTHONUNBUFFERED=1
ENV PYTHONDONTWRITEBYTECODE 1
# For node
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash -
RUN apt-get update
# For webpack (to generate bundles)
RUN apt-get install nodejs -y
# Setup workdir
RUN mkdir /src
WORKDIR /src
# JS dependencies
COPY package.json /src/
RUN npm install
# Python dependencies
COPY requirements.txt /src/
RUN pip install -r /src/requirements.txt
COPY . /src
And my fly.toml:
# fly.toml file generated for bears on 2022-05-28T07:32:02-04:00
app = "bears"
kill_signal = "SIGINT"
kill_timeout = 5
processes = []
[build]
dockerfile = "Dockerfile"
[env]
[experimental]
allowed_public_ports = []
auto_rollback = true
[[services]]
http_checks = []
internal_port = 8000
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"