Skip to content

Commit e87c119

Browse files
committed
added certbot for https
1 parent e36ec79 commit e87c119

File tree

5 files changed

+47
-5
lines changed

5 files changed

+47
-5
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
.PHONY: build
1+
.PHONY: build $(SERVICE)
22
build:
3-
docker compose -f docker-compose.yml -f docker-compose.dev.yml build
3+
docker compose -f docker-compose.yml -f docker-compose.dev.yml build $(SERVICE)
44

55
.PHONY: up
66
up:

docker-compose.dev.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ services:
1010
image: qutex_nginx:latest
1111
build:
1212
context: services/nginx
13+
environment:
14+
CERTBOT_EMAIL: avatheavian@gmail.com
15+
STAGING: "1"
16+
DEBUG: "1"
17+
RENEWAL_INTERVAL: 8d
1318
bot:
1419
<<: *interactive
1520
image: qutex_bot:latest
@@ -78,6 +83,19 @@ services:
7883
env_file: *env_files
7984
ports:
8085
- 27017:27017
86+
####################
87+
## -- DEV ONLY -- ## ( FOR NOW )
88+
####################
89+
mongo_ui:
90+
image: mongo-express:latest
91+
environment:
92+
ME_CONFIG_MONGODB_SERVER: mongo
93+
ME_CONFIG_MONGODB_ADMINUSERNAME: root
94+
ME_CONFIG_MONGODB_ADMINPASSWORD_FILE: /run/secrets/mongoPassword
95+
ports:
96+
- 8081:8081
97+
secrets:
98+
- mongoPassword
8199
volumes:
82100
# ignore all css from the docker container and do not mount to my local dir
83101
# This is because the CSS files shouldn't be modified. Only the sass files

docker-compose.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,23 @@ services:
1010
<<: *common
1111
image: ghcr.io/amthorn/qutex/qutex_nginx:${QUTEX_VERSION:-latest}
1212
depends_on:
13-
- web
13+
- ui
1414
- auth
1515
- projects
16+
- users
17+
environment:
18+
CERTBOT_EMAIL: avatheavian@gmail.com
19+
RENEWAL_INTERVAL: 8d
20+
volumes:
21+
- cert_files:/etc/letsencrypt
1622
ports:
1723
- target: 80
1824
published: 80
1925
mode: host
26+
- target: 443
27+
published: 443
28+
mode: host
29+
restart: always
2030
bot:
2131
<<: *common
2232
image: ghcr.io/amthorn/qutex/qutex_bot:${QUTEX_VERSION:-latest}
@@ -94,3 +104,4 @@ secrets:
94104
file: secrets/prod/privateKey
95105
volumes:
96106
mongo_volume:
107+
cert_files:

services/nginx/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM nginx
2-
COPY ./default.conf /etc/nginx/conf.d/default.conf
1+
FROM jonasal/nginx-certbot:latest
2+
COPY ./default.conf /etc/nginx/user_conf.d/default.conf
33

44
HEALTHCHECK --interval=30s --start-period=5s --timeout=10s --retries=3 CMD service --status-all |& grep "\[ + \] nginx$"

services/nginx/default.conf

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,21 @@ upstream projects {
1313
upstream users {
1414
server users:4000;
1515
}
16+
1617
server {
1718
listen 80;
19+
server_name qutexbot.com www.qutexbot.com;
20+
location / {
21+
return 301 https://$server_name$request_uri;
22+
}
23+
}
24+
25+
server {
26+
listen 443 ssl;
27+
server_name qutexbot.com www.qutexbot.com;
28+
ssl_certificate /etc/letsencrypt/live/qutex/fullchain.pem;
29+
ssl_certificate_key /etc/letsencrypt/live/qutex/privkey.pem;
30+
ssl_trusted_certificate /etc/letsencrypt/live/qutex/chain.pem;
1831

1932
# React's hot reload feature requires this to work properly
2033
# Only necessary for development

0 commit comments

Comments
 (0)