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

Documentation for building, configuring and deploying/running #22

Open
dassystem opened this issue Jun 14, 2024 · 3 comments
Open

Documentation for building, configuring and deploying/running #22

dassystem opened this issue Jun 14, 2024 · 3 comments
Labels
documentation Improvements or additions to documentation

Comments

@dassystem
Copy link

Hi I really like the application but I cannot get it running by myself.

Could you please provide documentation about how to correctly build, configure and deploy chordly?

I was able to build a docker image from the Dockerfile (with docker build) and run it (with docker run) but I don't find the ports and where to configure them? How do I start up the application? What do I need to setup first? How to access the web frontend?

In the next step I want to deploy it on a Raspberry Pi with linux/arm64 so I might need to setup multiarch docker building – but that's too far away at the moment and I would really appreciate help.

@stufro
Copy link
Owner

stufro commented Jun 15, 2024

The Dockerfile was generated by fly.io (my hosting provider) therefore I haven't ever built and run the image myself, I'd be happy to try to help you get it up and running though. You've actually got further than me as I can't even build the image on my M1 Mac currently - ha! 😄

Server Port

Looking at the config, when the Rails server starts, it uses the PORT env variable to decide which port to advertise the server on (config/puma.rb:18). In the Dockerfile, this env variable is set to 8080 (Dockerfile:132). I suppose when executing docker run you could set the port forwarding to expose that port on your host machine. (https://docs.docker.com/network/#published-ports)

How do I start the application?

I think docker run should start the server because in Dockerfile:135 it sets the CMD to be "bin/rails fly:server" which in turns calls sh 'bin/rails server' in lib/tasks/fly.rake

Other setup required

The only other thing I can think of is the database, in config/database.yml it's configured to use PostgreSQL and when running in production environment (which is where env variable RAILS_ENV=production) which in turns uses DATABASE_URL env variable.

If you have a PostgeSQL server running you could simply point DATABASE_URL to your server. A simpler approach might be to change the default adapter to sqlite3 on line 18 and set the DATABASE_URL to be a file path to save the SQLite database.


I hope that helps somewhat, let me know how you get on and if you have any further questions.

@dassystem
Copy link
Author

Thanks for your quick reply but I need more time to figure things out (I'm not an expert in ruby or even docker).

I was able to build, but not with sqlite! And with PostgreSQL I got an error running the container

sh: 1: cannot create /proc/sys/vm/swappiness: Read-only file system
rails aborted!

Seems like I have to investigate this stuff first. Then I'll have a look into the database topic.

@stufro stufro added the documentation Improvements or additions to documentation label Jul 21, 2024
@stufro
Copy link
Owner

stufro commented Jul 21, 2024

I was just reading my hosting providers docs again and found a much easier way to build and run this locally using docker. I tried added a docker compose file and building locally but still hitting some issues. I'll keep trying and let you know if I get it working.

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

No branches or pull requests

2 participants