Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
06e7275682 | ||
|
|
2c1b591fa6 | ||
|
|
d8eb08a5f1 | ||
|
|
20d83ffafe |
@@ -9,6 +9,7 @@ services:
|
|||||||
- db
|
- db
|
||||||
- etherpad
|
- etherpad
|
||||||
- back
|
- back
|
||||||
|
- front
|
||||||
networks:
|
networks:
|
||||||
- app-network
|
- app-network
|
||||||
|
|
||||||
@@ -24,6 +25,8 @@ services:
|
|||||||
- ../doodlestudent/front:/app
|
- ../doodlestudent/front:/app
|
||||||
environment:
|
environment:
|
||||||
- FLASK_ENV=development
|
- FLASK_ENV=development
|
||||||
|
depends_on:
|
||||||
|
- back
|
||||||
networks:
|
networks:
|
||||||
- app-network
|
- app-network
|
||||||
|
|
||||||
@@ -40,6 +43,8 @@ services:
|
|||||||
depends_on:
|
depends_on:
|
||||||
db:
|
db:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
etherpad:
|
||||||
|
condition: service_healthy
|
||||||
networks:
|
networks:
|
||||||
- app-network
|
- app-network
|
||||||
restart:
|
restart:
|
||||||
@@ -61,14 +66,22 @@ services:
|
|||||||
retries: 5
|
retries: 5
|
||||||
networks:
|
networks:
|
||||||
- app-network
|
- app-network
|
||||||
|
|
||||||
etherpad:
|
etherpad:
|
||||||
image: etherpad/etherpad
|
image: etherpad/etherpad:1.9.7
|
||||||
ports:
|
ports:
|
||||||
- "9001:9001"
|
- "9001:9001"
|
||||||
volumes:
|
volumes:
|
||||||
- ../doodlestudent/api/APIKEY.txt:/opt/etherpad-lite/APIKEY.txt
|
- ../doodlestudent/api/APIKEY.txt:/opt/etherpad-lite/APIKEY.txt
|
||||||
networks:
|
networks:
|
||||||
- app-network
|
- app-network
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD-SHELL", "node -e \"require('http').get('http://127.0.0.1:9001', res => { process.exit(res.statusCode===200?0:1) }).on('error', ()=>process.exit(1))\""]
|
||||||
|
interval: 30s
|
||||||
|
timeout: 10s
|
||||||
|
start_period: 15s
|
||||||
|
retries: 5
|
||||||
|
|
||||||
mail:
|
mail:
|
||||||
image: bytemark/smtp
|
image: bytemark/smtp
|
||||||
restart: always
|
restart: always
|
||||||
@@ -77,7 +90,7 @@ services:
|
|||||||
networks:
|
networks:
|
||||||
- app-network
|
- app-network
|
||||||
|
|
||||||
networks:
|
networks: # Declare the network to be used by the services
|
||||||
app-network:
|
app-network: # Is a user-defined network
|
||||||
#external: false
|
#external: false # If true, Docker Compose will look for an existing network with the same name and use it. If false or not specified, Docker Compose will create a new network.
|
||||||
name: app-network
|
name: app-network #Name of the network (optional, Docker Compose will generate one if not provided)
|
||||||
@@ -29,10 +29,12 @@ RUN chown 1001 /work \
|
|||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
USER 1001
|
USER 1001
|
||||||
|
|
||||||
#ENV quarkus_datasource_jdbc_url "jdbc:mysql://db:3306/tlc?allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&createDatabaseIfNotExist=true&serverTimezone=Europe/Paris"
|
|
||||||
ENV quarkus_datasource_jdbc_url "jdbc:mysql://db:3306/tlc?allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&createDatabaseIfNotExist=true&serverTimezone=Europe/Paris"
|
ENV quarkus_datasource_jdbc_url "jdbc:mysql://db:3306/tlc?allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&createDatabaseIfNotExist=true&serverTimezone=Europe/Paris"
|
||||||
ENV quarkus_datasource_username tlc
|
ENV quarkus_datasource_username tlc
|
||||||
ENV quarkus_datasource_password tlc
|
ENV quarkus_datasource_password tlc
|
||||||
ENV QUARKUS_HIBERNATE_ORM_DATABASE_GENERATION update
|
ENV QUARKUS_HIBERNATE_ORM_DATABASE_GENERATION update
|
||||||
|
ENV doodle_internalPadUrl "http://etherpad:9001/"
|
||||||
|
ENV doodle_externalPadUrl "http://etherpad:9001/"
|
||||||
|
ENV mailer_host mail
|
||||||
|
ENV mailer_port 25
|
||||||
CMD ["./application", "-Dquarkus.http.host=0.0.0.0"]
|
CMD ["./application", "-Dquarkus.http.host=0.0.0.0"]
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ RUN npx ng build
|
|||||||
FROM nginx:alpine
|
FROM nginx:alpine
|
||||||
|
|
||||||
COPY --from=build /app/dist/tlcfront /usr/share/nginx/html
|
COPY --from=build /app/dist/tlcfront /usr/share/nginx/html
|
||||||
|
COPY nginxFront.conf /etc/nginx/conf.d/default.conf
|
||||||
|
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|
||||||
|
|||||||
@@ -1,26 +0,0 @@
|
|||||||
server {
|
|
||||||
listen 80;
|
|
||||||
server_name _;
|
|
||||||
|
|
||||||
root /usr/share/nginx/html;
|
|
||||||
index index.html;
|
|
||||||
|
|
||||||
##########################
|
|
||||||
# Proxy API requests to the back service
|
|
||||||
##########################
|
|
||||||
location /api/ {
|
|
||||||
proxy_pass http://back:8080/api/;
|
|
||||||
proxy_http_version 1.1;
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
|
||||||
proxy_set_header Connection "";
|
|
||||||
}
|
|
||||||
##########################
|
|
||||||
# FrontEnd returns
|
|
||||||
##########################
|
|
||||||
location / {
|
|
||||||
try_files $uri $uri/ /index.html;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
90
nginx.conf
90
nginx.conf
@@ -1,5 +1,28 @@
|
|||||||
|
upstream front{
|
||||||
|
server front:5000;
|
||||||
|
}
|
||||||
|
|
||||||
|
upstream back{
|
||||||
|
server back:8080;
|
||||||
|
}
|
||||||
|
|
||||||
|
upstream etherpad{
|
||||||
|
server etherpad:9001;
|
||||||
|
}
|
||||||
|
|
||||||
|
upstream db{
|
||||||
|
server db:3306;
|
||||||
|
}
|
||||||
|
|
||||||
|
upstream smtp{
|
||||||
|
server smtp:25;
|
||||||
|
}
|
||||||
|
##########################
|
||||||
|
## FRONTEND + API
|
||||||
|
##########################
|
||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
|
listen [::]:80;
|
||||||
server_name _;
|
server_name _;
|
||||||
|
|
||||||
root /usr/share/nginx/html;
|
root /usr/share/nginx/html;
|
||||||
@@ -9,25 +32,7 @@ server {
|
|||||||
# Proxy API requests to the back service
|
# Proxy API requests to the back service
|
||||||
##########################
|
##########################
|
||||||
location /api/ {
|
location /api/ {
|
||||||
proxy_pass http://back:8080/;
|
proxy_pass http://back:8080;
|
||||||
proxy_http_version 1.1;
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
|
||||||
proxy_set_header Connection "";
|
|
||||||
}
|
|
||||||
location /web/ {
|
|
||||||
proxy_pass http://front:5080/;
|
|
||||||
proxy_http_version 1.1;
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
|
||||||
proxy_set_header Connection "";
|
|
||||||
}
|
|
||||||
location /pad/ {
|
|
||||||
proxy_pass http://etherpad:9001/;
|
|
||||||
proxy_http_version 1.1;
|
proxy_http_version 1.1;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
@@ -39,6 +44,51 @@ server {
|
|||||||
# FrontEnd returns
|
# FrontEnd returns
|
||||||
##########################
|
##########################
|
||||||
location / {
|
location / {
|
||||||
try_files $uri $uri/ /index.html;
|
proxy_pass http://front:5080;
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
proxy_set_header Connection "";
|
||||||
|
}
|
||||||
|
|
||||||
|
error_page 500 502 503 504 /50x.html;
|
||||||
|
location = /50x.html {
|
||||||
|
root /usr/share/nginx/html;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
##
|
||||||
|
## BACKEND
|
||||||
|
##
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
listen [::]:80;
|
||||||
|
server_name _;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
proxy_pass http://back:8080;
|
||||||
|
proxy_set_header Host $http_host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
##
|
||||||
|
## ETHERPAD
|
||||||
|
##
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
listen [::]:80;
|
||||||
|
server_name _;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
proxy_pass http://etherpad:9001;
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
|
proxy_set_header Connection "upgrade";
|
||||||
|
proxy_set_header Host $http_host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $remote_addr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
20
nginxFront.conf
Normal file
20
nginxFront.conf
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
server {
|
||||||
|
location /api/polls {
|
||||||
|
proxy_pass http://back:8080;
|
||||||
|
proxy_set_header Host $http_host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
}
|
||||||
|
|
||||||
|
location / {
|
||||||
|
root /usr/share/nginx/html;
|
||||||
|
index index.html index.htm;
|
||||||
|
try_files $uri $uri/ /index.html?$args;
|
||||||
|
}
|
||||||
|
|
||||||
|
error_page 500 502 503 504 /50x.html;
|
||||||
|
location = /50x.html {
|
||||||
|
root /usr/share/nginx/html;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user