Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error during deployment in Fly.io, Dockerfile needs to give permissons to start.sh script #231

Open
Mat-moran opened this issue May 1, 2023 · 3 comments

Comments

@Mat-moran
Copy link

Have you experienced this bug with the latest version of the template?

yes

Steps to Reproduce

Try to deploy on fly.io

Expected Behavior

Correct deployment

Actual Behavior

Error due to permissons of the entrypoint script.

 Starting init (commit: 15c0f38)...

2023-05-01T21:56:53.357 app[ad45d5fa] gdl [info] Preparing to run: `./start.sh` as root

2023-05-01T21:56:53.358 app[ad45d5fa] gdl [info] Error: failed to spawn command: ./start.sh: Permission denied (os error 13)

2023-05-01T21:56:53.358 app[ad45d5fa] gdl [info] does `./start.sh` exist and is it executable? 

I found the solution in this thread:
https://community.fly.io/t/unable-to-deploy-generic-remix-indie-stack/12429/2

It is necesary to add the next command before the entrypoint line to give permissons to the start.sh script.
RUN chmod +x /myapp/start.sh

@MichaelDeBoey
Copy link
Member

CC/ @rubys

@rubys
Copy link

rubys commented May 2, 2023

The complete fix needs a second line. There are a large number of potential issues that each impact only a small portion of the developers. This is one of them. In the short time that I've been looking at Remix, this is the second such issue.

One approach is to try to add to the Dockerfile template for all users. This quickly makes the Dockerfile less approachable.

Another is to detect situations like these and adjust the Dockerfile when the condition is present. And to augment the automatic detection with runtime flags to handle cases that can't automatically be detected. This is the approach fly takes with rails, and over time, a lot of flags have been added. Many of the same situations, such as this one, apply both to Rails and not just Remix but all Node projects.

This is why I'm encouraging Remix to converge with fly on a single dockerfile generator.

@felipeLx
Copy link

felipeLx commented Jul 3, 2023

I get a problem, not related with yours, trying to deploy the indie stack to fly.io because of the line: ENV PORT="8080"
The fly looks for the app on the port 3000
I was able to deploy after changing the port of the Dockerfile to 3000

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants