Summarizing URLs with ChatGPT
save yourself some reading time
- tags
- chatgpt
First lets create a new, simple sintara app
|
|
A simple config.ru
:
|
|
And then a very simple app.rb
|
|
Test with
|
|
mrsk
|
|
Create the config file
|
|
Created configuration file in config/deploy.yml Created .env file Created sample hooks in .mrsk/hooks
This will create config/deploy.yml
. For these tests, I created a
server and it's IP is below.
|
|
I'm using dockerhub to host my images. You'll need to generate a
token, and then put it in your .env
file.
Best practices are to not store the token in the file, but pull them out using a password manager. I'm using lasspass, so it looks like this:
MRSK_REGISTRY_PASSWORD=<%= `lpass show "Docker Token" | awk '/Notes/ {print $2}'`.strip %>
Which we can then generate .env
from using
|
|
Be sure to put .env
into .gitignore
!
Make sure that you have curl installed in your image, otherwise the health checks will fail!
|
|
The initial run for this took me 230
seconds.
|
|
One problem I had initially was that I didn't have curl
in my image,
which didn't make it work very well!
On your local machine, run curl
|
|
Hello world!
Now if we change our app.rb
and run mrsk deploy
, it only takes 29 seconds
and we can see
|
|
Hello world! From the redeploy
I'm building this locally on my M1 mac, and docker is running through
emulation. Lets have it build everything on the remote machine. Add
this to the config/deploy.yml
|
|
This only builds the amd64
architecture, and it happens on a remote
server. Which happens to be the server that we are deploying to.
a/k/a redis
Lets see how to add a redis database to our system.
First we need to add the accessory to our config/deploy.yml
file:
|
|
Then we need to set it up:
|
|
We can then see the status
|
|
INFO [4e06f84c] Running docker ps –filter label=service=sampleapp-redis on 95.216.175.53 INFO [4e06f84c] Finished in 1.446 seconds with exit status 0 (successful). CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 712f345b9cbb redis:latest "docker-entrypoint.s…" 7 minutes ago Up 7 minutes 0.0.0.0:36379->6379/tcp, :::36379->6379/tcp sampleapp-redis
This starts up the app. Now we need to update our code to actually use it!
|
|
Then our app.rb
:
|
|
|
|
Hello world, called 1 times
And
|
|
Hello world, called 2 times
I like tools that let you throw together sites really quickly. This is really interesting since it makes it easy to setup a fleet of servers, though that isn't something that I need to do that often.
You'd need to setup load balancers in front and probably something like cloudflare to handle SSL and all that stuff, but its way simplier than kubernetes.
I really like the ability to have it run off of a totally unsetup server, it installs docker and everything else for you. Very nifty.
I'd like to see something like this but configured Caddy instead and let you host many sites on one platform.
Previously
Next