blob: be935f04b3139d38307b3d743475a40aeda2aa85 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
# submelon.dev
## Deploying Using Docker
The Dockerfile works via a fresh clone, no pre-build or npm install is needed. It can be tagged as follows:
```
docker build --push -t registry.digitalocean.com/submelon-tech/submelon.tech:1.0.0 .
```
(Reference authenticating to use DigitalOcean's Container Registry below.)
If the build fails in error as a result of the image, the base gatsby images can be rebuilt. (The gatsby images as exist on Dockerhub do not work.) To rebuild those images, run the following commands:
To note, the gatsby-docker repository is now out of date. A newer node image must be used.
```
cd ..
git clone https://github.com/gatsbyjs/gatsby-docker
cd gatsby-docker
# Change node:12-buster to node:lts-buster in Dockerfile.onbuild
docker build -t gatsbyjs/gatsby:onbuild -f Dockerfile.onbuild .
docker build -t gatsbyjs/gatsby:latest -f Dockerfile .
```
And then attempt rebuild of the submelon.tech image.
### Authenticating with DO
Install `doctl`. Create an access token via DO's web interface to authenticate with the registry, and connect docker:
```
doctl auth init
doctl registry login
```
### DO K8s Deployment
To access the DO k8s cluster, save the config. It will automatically switch to use this context:
```
doctl k8s cluster cfg save k8s-1-13-1-do-2-nyc1-1547908941746
```
Then to switch to use this context in the future:
```
kubectl config use-context do-nyc1-k8s-1-13-1-do-2-nyc1-1547908941746
```
Make version/environment changes to deployment config file, and apply:
```
kubectl apply -f kubernetes/deployment.yaml
```
|