added deployment article
This commit is contained in:
parent
cc742a0e02
commit
750dc461f2
|
|
@ -26,4 +26,12 @@ I let gatsby create an instance of the blog template for me. From this template
|
|||
|
||||
# How this is run
|
||||
|
||||
I mentioned `docker` before. [It seems to be officially supported](https://github.com/gatsbyjs/gatsby-docker). I just went with the documentation and tried to get it to run.
|
||||
I mentioned `docker` before. [It seems to be officially supported](https://github.com/gatsbyjs/gatsby-docker). I just went with the documentation and tried to get it to run. First, I created a `Dockerfile` in the project with just one line of content:
|
||||
|
||||
FROM gatsbyjs/gatsby:onbuild
|
||||
|
||||
Then, I could build first the gatsby project with `npx gatsby build` and use the optimized output from that to build a docker image with `docker build -t while-false/blog .` from the context of my project root. Next, I started a container from the newly created image with `docker run -d --name blog -p 8080:80 while-false/blog`. It worked on my laptop for `localhost:8080`, I saw the blog I just built. Nice!
|
||||
|
||||
But a blog only for myself on my laptop is a bit boring. So I went on to deploy it on my server (where you are probably reading it right now). I went for the low-tech solution first: I `ssh`d into the server, cloned the git repo, built the gatsby project, built the docker image and spun it up behind my nginx reverse proxy (which I will discuss in a future blog article).
|
||||
|
||||
That's it for a short overview. Maybe I will show some details in the future, let me know if you have specific questions.
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
body {
|
||||
background-color: '#e3dcc2'
|
||||
background-color: #e3dcc2;
|
||||
}
|
||||
|
||||
code {
|
||||
|
|
|
|||
Loading…
Reference in New Issue