Skip to content

Commit c86427c

Browse files
authored
Update README.md
1 parent 3455a41 commit c86427c

File tree

1 file changed

+72
-5
lines changed

1 file changed

+72
-5
lines changed

README.md

Lines changed: 72 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,8 @@ Now looking back, I also put the 3\* and below servants in their own slice as we
191191
- Frontend -> Vercel
192192
- Database + Server -> baremetal Linux VPS
193193

194+
### As a process on baremetal
195+
194196
To deploy, the following steps I took were:
195197

196198
Get the API server running and listening on `localhost:8080`
@@ -204,6 +206,11 @@ Get the API server running and listening on `localhost:8080`
204206
7. Start `tmux`
205207
8. Run the server `./server`
206208

209+
### As Docker container on baremetal
210+
211+
1. Install Docker on the Linux server \[ [Debian](https://docs.docker.com/engine/install/debian/) | [RHEL](https://docs.docker.com/engine/install/rhel/) \]
212+
2. Run `docker run -dp 8080:8080 ghcr.io/aaanh/reroll.ing/server:latest` [or the versions you need](https://github.com/aaanh/reroll.ing/pkgs/container/reroll.ing%2Fserver)
213+
207214
Networking
208215

209216
1. Add the server's static IP to DNS A record on Cloudflare
@@ -212,11 +219,71 @@ Networking
212219

213220
```nginx
214221
server {
215-
server_name _; // catch all
216-
217-
location / {
218-
proxy_pass http://localhost:8080
219-
}
222+
223+
if ($host != api.reroll.ing) {
224+
return 444;
225+
}
226+
227+
# Add index.php to the list if you are using PHP
228+
# index index.html index.htm index.nginx-debian.html;
229+
230+
server_name _ api.reroll.ing;
231+
232+
location / {
233+
root /var/www/html;
234+
index index.html index.htm;
235+
}
236+
237+
location /health {
238+
proxy_pass http://localhost:8080;
239+
}
240+
241+
location /roll/ {
242+
proxy_pass http://localhost:8080;
243+
}
244+
245+
location /stats/total_servants {
246+
proxy_pass http://localhost:8080;
247+
}
248+
249+
location /servants {
250+
proxy_pass http://localhost:8080;
251+
}
252+
253+
location /servants/ {
254+
proxy_pass http://localhost:8080;
255+
}
256+
257+
location /assets/ {
258+
alias /var/www/reroll.ing/assets/;
259+
}
260+
261+
262+
listen [::]:443 ssl http2;
263+
listen 443 ssl http2;
264+
ssl_certificate /etc/ssl/cert.pem;
265+
ssl_certificate_key /etc/ssl/key.pem;
266+
ssl_client_certificate /etc/ssl/cloudflare.crt;
267+
ssl_verify_client off;
268+
}
269+
270+
271+
server {
272+
273+
if ($host != api.reroll.ing) {
274+
return 444;
275+
}
276+
277+
if ($host = api.reroll.ing) {
278+
return 301 https://$host$request_uri;
279+
} # managed by Certbot
280+
281+
282+
listen 80 default_server;
283+
listen [::]:80 default_server;
284+
285+
server_name api.reroll.ing;
286+
return 404; # managed by Certbot
220287
}
221288
```
222289

0 commit comments

Comments
 (0)