Skip to content
This repository was archived by the owner on May 11, 2022. It is now read-only.

Commit 7591b1a

Browse files
committed
fix #41: define web server
1 parent 2f849cf commit 7591b1a

File tree

7 files changed

+127
-4
lines changed

7 files changed

+127
-4
lines changed

env/docker/compose/base.yml

+9
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,15 @@ services:
1616
# env_file:
1717
# - ../monitoring/.env
1818

19+
server:
20+
image: octopot/tablo:server
21+
build:
22+
context: ../server
23+
depends_on:
24+
- service
25+
env_file:
26+
- ../server/.env
27+
1928
service:
2029
image: octopot/tablo:latest
2130
build:

env/docker/compose/demo.yml

+26-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,28 @@
11
version: "3"
22

3-
services: {}
3+
services:
4+
5+
server:
6+
command: tablo.octolab.org
7+
environment:
8+
- DEV_ENABLED=false
9+
- LE_ENABLED=true
10+
11+
ports:
12+
- 80:80
13+
- 443:443
14+
volumes:
15+
- certificates:/etc/nginx/ssl
16+
- letsencrypt:/etc/letsencrypt
17+
18+
storage:
19+
volumes:
20+
- pgdata:/var/lib/postgresql/data
21+
22+
volumes:
23+
24+
certificates: { driver: local }
25+
letsencrypt: { driver: local }
26+
27+
pgdata: { driver: local }
28+

env/docker/compose/dev.yml

+11
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@ version: "3"
22

33
services:
44

5+
server:
6+
ports:
7+
- 80:80
8+
- 443:443
9+
volumes:
10+
- certificates:/etc/nginx/ssl
11+
- letsencrypt:/etc/letsencrypt
12+
513
service:
614
ports:
715
- 8080:8080
@@ -14,4 +22,7 @@ services:
1422

1523
volumes:
1624

25+
certificates: { driver: local }
26+
letsencrypt: { driver: local }
27+
1728
pgdata: { driver: local }

env/docker/server/.env

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
BASIC_USER=admin
2+
BASIC_PASS=admin
3+
4+
DEV_ENABLED=true
5+
LE_ENABLED=false
6+
LE_EMAIL=
7+
TIME_ZONE=UTC

env/docker/server/Dockerfile

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
FROM scratch
1+
FROM kamilsk/nginx:alpine AS server
22

33
LABEL maintainer="Kamil Samigullin <[email protected]>"
4+
5+
COPY conf.d /etc/nginx/sites-available

env/docker/server/conf.d/service.conf

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
upstream service { server service:8080; }
2+
# upstream grpc { server service:8090; }
3+
# upstream profiling { server service:8091; }
4+
# upstream telemetry { server service:8092; }
5+
# upstream vault { server vault:8200; }
6+
7+
server {
8+
listen 80;
9+
listen [::]:80;
10+
11+
#:https listen 443 ssl http2;
12+
#:https listen [::]:443 ssl http2;
13+
#:https ssl_certificate ${SSL_CERT};
14+
#:https ssl_certificate_key ${SSL_KEY};
15+
#:https #:le ssl_trusted_certificate ${SSL_CHAIN};
16+
#:https ssl_dhparam /etc/nginx/ssl/dhparams.pem;
17+
#:https ssl_ecdh_curve prime256v1:secp384r1:secp521r1;
18+
#:https include h5bp/directive-only/ssl.conf;
19+
#:https #:le include h5bp/directive-only/ssl-stapling.conf;
20+
#:https if ($scheme = http) {
21+
#:https return 301 https://$server_name$request_uri;
22+
#:https }
23+
#:https add_header Strict-Transport-Security "max-age=86400" always;
24+
25+
server_name tablo.octolab.org tablo.127.0.0.1.xip.io;
26+
27+
charset utf-8;
28+
index index.html;
29+
root /usr/share/nginx/html;
30+
31+
etag on;
32+
33+
location = /favicon.ico { log_not_found off; access_log off; }
34+
location /.well-known/ { root /usr/share/nginx/html; }
35+
36+
location /api/ {
37+
rewrite ^/api/(.*) /$1 break;
38+
39+
proxy_redirect off;
40+
proxy_buffering off;
41+
proxy_pass http://service;
42+
proxy_set_header Host $http_host;
43+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
44+
proxy_set_header X-Forwarded-Proto $scheme;
45+
proxy_set_header X-Real-IP $remote_addr;
46+
}
47+
48+
# location /grpc/ {
49+
# rewrite ^/grpc/(.*) /$1 break;
50+
#
51+
# grpc_pass grpc://grpc;
52+
# }
53+
54+
# location /vault/ {
55+
# rewrite ^/vault/(.*) /$1 break;
56+
#
57+
# proxy_redirect off;
58+
# proxy_buffering off;
59+
# proxy_pass http://vault;
60+
# proxy_set_header Host $http_host;
61+
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
62+
# proxy_set_header X-Forwarded-Proto $scheme;
63+
# proxy_set_header X-Real-IP $remote_addr;
64+
# }
65+
66+
include h5bp/directive-only/x-ua-compatible.conf;
67+
include h5bp/directive-only/extra-security.conf;
68+
include h5bp/directive-only/no-transform.conf;
69+
}

env/docker/service/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ ENV BIND=0.0.0.0 \
2929
HTTP_PORT=8080 \
3030
GRPC_PORT=8090 \
3131
PROFILING_PORT=8091 \
32-
MONITORING_PORT=8092
32+
TELEMETRY_PORT=8092
3333

3434
EXPOSE ${HTTP_PORT} \
3535
${GRPC_PORT} \
3636
${PROFILING_PORT} \
37-
${MONITORING_PORT}
37+
${TELEMETRY_PORT}
3838

3939
ENTRYPOINT [ "service" ]
4040
CMD [ "help", "run" ]

0 commit comments

Comments
 (0)