Open andrewculver opened 2 years ago
As you can tell by the number of commits on the branch I started working on, this one's taking some effort to get moving. I've been going back and forth with Digital Ocean's support team for a bit and have gotten to the point where the site is deployed, but I'm getting an error when trying to actually access the site.
Although it's kind of old, I'm putting this video here for reference.
Currently trying to attach a database, since the details in the template I wrote aren't seeming to pick up on production: true
.
@andrewculver I’ve spent a decent amount of time on this, and I’ve come to the conclusion that a one-click deploy button is great for static websites and applications early in the development process, but for a number of reasons I don’t think that this is currently a viable option for Bullet Train and that BT devs will be better off simply going the whole 9 yards by setting up everything via Digital Ocean for their Bullet Train.
Here are the reasons why:
DATABASE_URL
connection string until after the app successfully deploys. You then grab it from the db settings and set it as an environment variable (in my opinion, Render took care of this better in that you didn’t need to have a successful deployment first).rake db:migrate
in the console. I wanted to automate this step instead of just write it in the console so I asked customer support about it, and they said I needed to use a post-deploy job for this. This isn’t something configured in the deploy template, but in the dashboard. It takes a few steps which can be read in this page in the docs that customer support sent to me.bin/dev
to spin up multiple processes. In the app platform, which is what one-click deployment uses, each component is one container so we can’t use multiple servers (rails s + sidekiq, etc.). Customer support told me however that this can be done by creating a droplet. If it comes to that, I think Bullet Train devs would just better off configuring a droplet from the start and deploying that way.I’ve read a bunch of Digital Ocean’s articles in the past and I’m sure their service is great, I just think that trying to use one-click deployment will cause more headaches than anything when a lot else has to be configured just to get things moving. The impression I also get from the one-click docs is that it's used more just to test things out, and not for full-on production.
By the way, here’s the spec I used in the digital-ocean-deployment branch:
spec:
name: bullet-train
services:
- name: web
git:
repo_clone_url: https://github.com/gazayas/bullet_train.git
branch: digital-ocean-deployment
envs:
- key: BASE_URL
# TODO: Replace this with the URL Digital Ocean provides after successfully deploying your application.
value: http://localhost:3000/
scope: RUN_AND_BUILD_TIME
- key: SECRET_KEY_BASE
scope: RUN_AND_BUILD_TIME
databases:
- name: bullet-train-dev
engine: PG
production: false
Also, here is the deployed website after attaching the connection string and migrating the database.
@gazayas @andrewculver It sounds like maybe the thing to do here is to provide a page in the /docs
area that describes how to deploy to Digital Ocean. Unless things have changed significantly at DO over the last year?
@jagthedrummer I'm open to either solution, thinking back on this one I just remember this being pretty difficult to implement. A lot has changed since then though, so if we want to prioritize it I can take another shot at it.
@gazayas no need to prioritize it as far as I'm concerned.
Looks like both PostgreSQL and Redis are configured under "databases".