Closed mingchau closed 1 year ago
Hi! I tried your fly.yml and it worked for me.
One difference I could find in your fly.toml
was that I got this line
[build]
dockerfile = "Dockerfile"
Maybe that will help
Also, my Dockerfile also looks different, but I'm running a Django app.
ARG PYTHON_VERSION=3.10-slim-buster
FROM python:${PYTHON_VERSION}
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
RUN mkdir -p /code
WORKDIR /code
COPY requirements.txt /tmp/requirements.txt
RUN set -ex && \
pip install --upgrade pip && \
pip install -r /tmp/requirements.txt && \
rm -rf /root/.cache/
COPY . /code/
RUN python ./manage.py collectstatic
EXPOSE 8000
CMD ["gunicorn", "--bind", ":8000", "--workers", "2", "mysite.wsgi"]
Can you deploy it from your own computer?
Ohh, I missed one thing. I added --remote-only
on the last line in fly.yml
, so it looks like this: flyctl deploy --remote-only
. All the docs got it.
Hi @eliasj , thank you for the reply.
Yes, I could deploy it with my own Windows 10 PC and flyctl deploy --local-only
command, but flyctl deploy --remote-only
command on my PC always stuck on
Waiting for remote builder
That's why I want to try to deploy it with GitHub Actions.
After adding
[build]
dockerfile = "Dockerfile"
and --remote-only
in the specified files, it still fails with the similar error message.
Can you please share more about your fly.yml
file?
Finally, I found the problem was caused by the .dockerignore
file, which was auto-generated, so I've assumed it's ok.😅
There is error log which I ignored says:
time="**" level=error msg="Error matching .dockerignore: syntax error in pattern"
Replacing the \
with /
in the .dockerignore
file, everything goes good!
Are you running on a Windows machine? Just for reference, if someone gets this error in the future.
Are you running on a Windows machine? Just for reference, if someone gets this error in the future.
Sorry, I made a typo in the previous reply, it should be the .dockerignore
file, not the .gitignore file. I have edited it.
Yes, I am using a Windows PC. The file was generated by flyctl.
Files contents:
Dockerfile:
fly.toml
.github\workflows\fly.yml
GitHub Repo file structure:![image](https://user-images.githubusercontent.com/18564039/211823064-83f5e38f-3ddf-4c01-8750-ba538b0df6d8.png)
GitHub Actions Log:
![image](https://user-images.githubusercontent.com/18564039/211823381-b96afabe-ea81-434b-89a2-7e5e9df0d224.png)