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

Setup one click deployment to railway #356

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

fadexadex
Copy link

What kind of change does this PR introduce?

I included two new files in the folder directory, "Dockerfile.railway" and railway.toml. I also included the template button link to the readme file to allow for a one click deploy on railway. I have tested the changes with a sample deployment on my railway dashboard to ensure the changes work as expected
image

Why was this change needed?

So the reason for the new file "Dockerfile.railway" was because volumes are banned in railway, so I was forced to use the inbuilt volume from railway and delete the volume declarations from the docker file. However, I didn't want to alter the main Dockerfile.dev so it doesn't affect the other one click deployment options that would be implemented later. The railway.toml file was to direct railway to the Docker file on the build instructions.

Other information:

Yes I chatted with the author of the issue for guidance while working on it. I had to also make a compromise with the VOLUME, instead of two I setup just one volume in the template which is "/upload", the reason for this is because railway doesn't allow creation of more than a single volume.

Checklist:

Put a "X" in the boxes below to indicate you have followed the checklist;

  • I have read the CONTRIBUTING guide.
  • I checked that there were not similar issues or PRs already open for this.
  • This PR fixes just ONE issue (do not include multiple issues or types of change in the same PR) For example, don't try and fix a UI issue and include new dependencies in the same PR.

Copy link

vercel bot commented Oct 12, 2024

@fadexadex is attempting to deploy a commit to the Listinai Team on Vercel.

A member of the Team first needs to authorize it.

@nevo-david
Copy link
Contributor

This is so awesome!
Did you manage to check it? (Schedule a post and see if it's being posted)

@fadexadex
Copy link
Author

fadexadex commented Oct 12, 2024

Oops I forgot to add the environment variables, let me get on that now, when a user runs a one click deploy, they would need to include their cloud fare info right?

@nevo-david
Copy link
Contributor

No, you created the volume with the /uploads, cloudflare is not necessary

@fadexadex
Copy link
Author

Alright, I am trying to redeploy with the required envs so I can test

@fadexadex
Copy link
Author

This is the link to the deployed app

postiz-app-production-9283.up.railway.app

The create account is not working as expected could it be because of the exclusion of the /config volume?

@jamesread
Copy link
Collaborator

Heya, at first I was a bit freaked out by this, but actually this generally looks fine. :-) I do worry a bit about having so much duplication between the two dockerfiles though, but I cannot see a way around this at the moment.

So, this technically should work without /config or /uploads, as long as railway allows you to set runtime environement variables.

Your test deployment isn't working at the moment because the NEXT_PUBLIC_BACKEND_URL is set to the default (http://localhost:3000). You would need to set this in the docker runtime environement variables to be htts://postiz-app-production-9283.up.railway.app/api/.

@fadexadex
Copy link
Author

Ohh alright, I would make the change.

@fadexadex
Copy link
Author

fadexadex commented Oct 14, 2024

So I made changes and redeployed but still have issues interacting with the deployed link
image

@fadexadex
Copy link
Author

Hello sir any help with this sir?@jamesread

@jamesread
Copy link
Collaborator

Yeah, so you've set it, but it's still set to the wrong values, so it's causing CORs errors.

What's your public deployed URL, and your .env look like?

@fadexadex
Copy link
Author

image
Deployed URL - postiz-app-production-fd8d.up.railway.app

@bayraak
Copy link

bayraak commented Nov 2, 2024

API is wrongly configured, there is no any mapping to exposed port (/api -> 3000)

@fadexadex
Copy link
Author

Can you please explain further, like it should be 3000 for the backend url?

@bayraak
Copy link

bayraak commented Nov 2, 2024

Can you please explain further, like it should be 3000 for the backend url?

I'm not an official maintainer, just trying to deploy it with your solution.

About the problem; I see that /api URL goes to Next JS server (routing) but not to back-end which works internally at Port 3000.

There should be logic that maps 3000 port to that /api path or similar (configured in Railway). But I'm not able to find a way too. On Railway UI, only one URI -> PORT mapping can be configured

@jamesread
Copy link
Collaborator

You should use port 5000 for everything, don't use the port :4200 and :3000 directly anymore. Check out the postiz docs on the pre-reqs to understand more.

@candidexmedia
Copy link

Has anyone had any success with this?

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

Successfully merging this pull request may close these issues.

5 participants