mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-20 04:39:20 +00:00
Merge pull request #389 from ricardoapaes/feature/docker-for-production-v3
🐳 Enhancing and Fixing Docker for Production
This commit is contained in:
@@ -21,4 +21,7 @@ FRONTEND_SERVER_NAME=myapp.mydomain.com
|
|||||||
FRONTEND_URL=https://myapp.mydomain.com
|
FRONTEND_URL=https://myapp.mydomain.com
|
||||||
|
|
||||||
# BROWSERLESS
|
# BROWSERLESS
|
||||||
MAX_CONCURRENT_SESSIONS=
|
MAX_CONCURRENT_SESSIONS=
|
||||||
|
|
||||||
|
# PHPMYADMIN
|
||||||
|
PMA_PORT=
|
||||||
@@ -49,6 +49,10 @@ docker run --name whaticketdb -e MYSQL_ROOT_PASSWORD=strongpassword -e MYSQL_DAT
|
|||||||
# Or run using `docker-compose` as below
|
# Or run using `docker-compose` as below
|
||||||
# Before copy .env.example to .env first and set the variables in the file.
|
# Before copy .env.example to .env first and set the variables in the file.
|
||||||
docker-compose up -d mysql
|
docker-compose up -d mysql
|
||||||
|
|
||||||
|
# To administer this mysql database easily using phpmyadmin.
|
||||||
|
# It will run by default on port 9000, but can be changed in .env using `PMA_PORT`
|
||||||
|
docker-compose -f docker-compose.phpmyadmin.yaml up -d
|
||||||
```
|
```
|
||||||
|
|
||||||
Install puppeteer dependencies:
|
Install puppeteer dependencies:
|
||||||
@@ -179,6 +183,10 @@ docker run --name whaticketdb -e MYSQL_ROOT_PASSWORD=strongpassword -e MYSQL_DAT
|
|||||||
# Or run using `docker-compose` as below
|
# Or run using `docker-compose` as below
|
||||||
# Before copy .env.example to .env first and set the variables in the file.
|
# Before copy .env.example to .env first and set the variables in the file.
|
||||||
docker-compose up -d mysql
|
docker-compose up -d mysql
|
||||||
|
|
||||||
|
# To administer this mysql database easily using phpmyadmin.
|
||||||
|
# It will run by default on port 9000, but can be changed in .env using `PMA_PORT`
|
||||||
|
docker-compose -f docker-compose.phpmyadmin.yaml up -d
|
||||||
```
|
```
|
||||||
|
|
||||||
Clone this repository:
|
Clone this repository:
|
||||||
|
|||||||
15
docker-compose.phpmyadmin.yaml
Normal file
15
docker-compose.phpmyadmin.yaml
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
version: '3'
|
||||||
|
|
||||||
|
networks:
|
||||||
|
whaticket:
|
||||||
|
|
||||||
|
services:
|
||||||
|
|
||||||
|
phpmyadmin:
|
||||||
|
image: phpmyadmin/phpmyadmin:latest
|
||||||
|
environment:
|
||||||
|
- PMA_HOSTS=mysql
|
||||||
|
ports:
|
||||||
|
- ${PMA_PORT:-9000}:80
|
||||||
|
networks:
|
||||||
|
- whaticket
|
||||||
@@ -22,6 +22,8 @@ services:
|
|||||||
- CHROME_ARGS=--no-sandbox --disable-setuid-sandbox
|
- CHROME_ARGS=--no-sandbox --disable-setuid-sandbox
|
||||||
ports:
|
ports:
|
||||||
- ${BACKEND_PORT:-8080}:3000
|
- ${BACKEND_PORT:-8080}:3000
|
||||||
|
volumes:
|
||||||
|
- ./backend/public/:/usr/src/app/public/
|
||||||
networks:
|
networks:
|
||||||
- whaticket
|
- whaticket
|
||||||
|
|
||||||
|
|||||||
@@ -12,13 +12,16 @@ _addSslConfig() {
|
|||||||
SSL_CERTIFICATE=/etc/nginx/ssl/${1}/fullchain.pem;
|
SSL_CERTIFICATE=/etc/nginx/ssl/${1}/fullchain.pem;
|
||||||
SSL_CERTIFICATE_KEY=/etc/nginx/ssl/${1}/privkey.pem;
|
SSL_CERTIFICATE_KEY=/etc/nginx/ssl/${1}/privkey.pem;
|
||||||
FILE_CONF=/etc/nginx/sites.d/${1}.conf
|
FILE_CONF=/etc/nginx/sites.d/${1}.conf
|
||||||
|
FILE_SSL_CONF=/etc/nginx/conf.d/00-ssl-redirect.conf;
|
||||||
|
|
||||||
if [ -f ${SSL_CERTIFICATE} ] && [ -f ${SSL_CERTIFICATE_KEY} ]; then
|
if [ -f ${SSL_CERTIFICATE} ] && [ -f ${SSL_CERTIFICATE_KEY} ]; then
|
||||||
echo "saving ssl config in ${FILE_CONF}"
|
echo "saving ssl config in ${FILE_CONF}"
|
||||||
|
echo 'include include.d/ssl-redirect.conf;' >> ${FILE_SSL_CONF};
|
||||||
echo 'include "include.d/ssl.conf";' >> ${FILE_CONF};
|
echo 'include "include.d/ssl.conf";' >> ${FILE_CONF};
|
||||||
echo "ssl_certificate ${SSL_CERTIFICATE};" >> ${FILE_CONF};
|
echo "ssl_certificate ${SSL_CERTIFICATE};" >> ${FILE_CONF};
|
||||||
echo "ssl_certificate_key ${SSL_CERTIFICATE_KEY};" >> ${FILE_CONF};
|
echo "ssl_certificate_key ${SSL_CERTIFICATE_KEY};" >> ${FILE_CONF};
|
||||||
else
|
else
|
||||||
|
echo 'listen 80;' >> ${FILE_CONF};
|
||||||
echo "ssl ${1} not found >> ${SSL_CERTIFICATE} -> ${SSL_CERTIFICATE_KEY}"
|
echo "ssl ${1} not found >> ${SSL_CERTIFICATE} -> ${SSL_CERTIFICATE_KEY}"
|
||||||
fi;
|
fi;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
include include.d/ssl-redirect.conf;
|
client_max_body_size 20M;
|
||||||
|
|
||||||
upstream backend {
|
upstream backend {
|
||||||
server {{ .Env.URL_BACKEND }};
|
server {{ .Env.URL_BACKEND }};
|
||||||
|
|||||||
Reference in New Issue
Block a user