Skip to content

Commit 5e1e955

Browse files
committed
update dockerfiles, add nginx config
1 parent e2ba154 commit 5e1e955

7 files changed

Lines changed: 56 additions & 12 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ The sqtracker client service provides the modern, responsive web interface that
8989

9090
The HTTP proxy allows the client, API, and BitTorrent tracker to all be accessible via a single endpoint.
9191

92+
Traefik is recommended and is configured by default. An Nginx config file is also provided for those that prefer it and the `docker-compose.yml` file contains an Nginx block that can be enabled.
93+
9294
### Deploying with Docker compose
9395

9496
The sqtracker platform is designed to be deployed via Docker. Once a configuration file is created, deploying is as simple as running `docker compose up -d` at the root of the project.

api/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:16-alpine
1+
FROM node:16
22
ENV NODE_ENV=production
33
ENV SENTRY_DSN="https://9b9761216607428180ea3b32bd1c8e58@o140996.ingest.sentry.io/4504645996576768"
44
LABEL org.opencontainers.image.source=https://github.com/tdjsnelling/sqtracker

api/src/utils/validateConfig.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,4 @@
11
import * as yup from "yup";
2-
import en from "@sqtracker/client/locales/en.json";
3-
import es from "@sqtracker/client/locales/es.json";
4-
import it from "@sqtracker/client/locales/it.json";
5-
import ru from "@sqtracker/client/locales/ru.json";
6-
import de from "@sqtracker/client/locales/de.json";
7-
import zh from "@sqtracker/client/locales/zh.json";
8-
import eo from "@sqtracker/client/locales/eo.json";
9-
import fr from "@sqtracker/client/locales/fr.json";
102

113
const httpRegex = /http(s)?:\/\/.*/;
124
const mongoRegex = /mongodb:\/\/.*/;

client/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:16-alpine AS builder
1+
FROM node:16 AS builder
22
ARG SENTRY_AUTH_TOKEN
33
ENV NODE_ENV=production
44
ENV SENTRY_ORG=tdjsnelling

docker-compose.dev.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,17 @@ services:
1717
volumes:
1818
- "/var/run/docker.sock:/var/run/docker.sock:ro"
1919
- ./traefik.yml:/config/traefik.yml
20+
# nginx:
21+
# image: "nginx:latest"
22+
# container_name: "sq_nginx"
23+
# restart: always
24+
# ports:
25+
# - "80:80"
26+
# volumes:
27+
# - ./nginx.conf:/etc/nginx/nginx.conf
2028
database:
2129
container_name: sq_mongodb
2230
image: mongo:6.0
23-
ports:
24-
- "127.0.0.1:27017:27017"
2531
volumes:
2632
- ./data:/data/db
2733
api:

docker-compose.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@ services:
2323
- "/var/run/docker.sock:/var/run/docker.sock:ro"
2424
- ./letsencrypt:/letsencrypt
2525
- ./traefik.yml:/config/traefik.yml
26+
# nginx:
27+
# image: "nginx:latest"
28+
# container_name: "sq_nginx"
29+
# restart: always
30+
# ports:
31+
# - "80:80"
32+
# volumes:
33+
# - ./nginx.conf:/etc/nginx/nginx.conf
2634
database:
2735
container_name: sq_mongodb
2836
image: mongo:6.0

nginx.conf

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
events {}
2+
3+
http {
4+
server {
5+
listen 80;
6+
resolver 127.0.0.11;
7+
8+
location / {
9+
proxy_pass http://sq_client:3000;
10+
proxy_redirect off;
11+
proxy_set_header Host $host;
12+
proxy_set_header X-Real-IP $remote_addr;
13+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
14+
proxy_set_header X-Forwarded-Host $server_name;
15+
}
16+
17+
location /api/ {
18+
rewrite /api/(.*) /$1 break;
19+
proxy_pass http://sq_api:3001;
20+
proxy_redirect off;
21+
proxy_set_header Host $host;
22+
proxy_set_header X-Real-IP $remote_addr;
23+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
24+
proxy_set_header X-Forwarded-Host $server_name;
25+
}
26+
27+
location /sq/ {
28+
proxy_pass http://sq_api:3001;
29+
proxy_redirect off;
30+
proxy_set_header Host $host;
31+
proxy_set_header X-Real-IP $remote_addr;
32+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
33+
proxy_set_header X-Forwarded-Host $server_name;
34+
}
35+
}
36+
}

0 commit comments

Comments
 (0)