first commit
This commit is contained in:
@@ -0,0 +1,78 @@
|
||||
wap2: 5pJ/t/AJ&Hs8DZ
|
||||
wap2 ipv4: 168.181.187.116
|
||||
wap2 ipv6: 2800:6c0:5::2123
|
||||
|
||||
|
||||
|
||||
DOCKER:
|
||||
======
|
||||
sudo apt-get update
|
||||
sudo apt-get install ca-certificates curl
|
||||
sudo install -m 0755 -d /etc/apt/keyrings
|
||||
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
|
||||
sudo chmod a+r /etc/apt/keyrings/docker.asc
|
||||
echo \
|
||||
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
|
||||
$(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") stable" | \
|
||||
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
|
||||
sudo apt-get update
|
||||
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
|
||||
|
||||
sudo usermod -aG docker $USER
|
||||
|
||||
|
||||
|
||||
|
||||
CREAR IMAGENES DE DOCKER
|
||||
========================
|
||||
|
||||
Copiar los archivos de las carpetas de bot-admin-api y txbot
|
||||
|
||||
- Dentro de la carpeta de txbot:
|
||||
docker build -t txbot .
|
||||
- Dentro de la carpeta bot-admin-api
|
||||
docker build -t bot-admin-api .
|
||||
docker compose up -d
|
||||
|
||||
INSTALAR NGINX
|
||||
==============
|
||||
|
||||
sudo apt update
|
||||
sudo apt install -y nginx
|
||||
sudo systemctl enable nginx
|
||||
sudo systemctl start nginx
|
||||
systemctl status nginx
|
||||
|
||||
cd /etc/nginx/sites-enabled
|
||||
sudo rm -r default
|
||||
|
||||
cd /etc/nginx/sites-available
|
||||
sudo rm -r default
|
||||
|
||||
nano wap1.turnosxpress.com.ar
|
||||
|
||||
server {
|
||||
server_name wap1.turnosxpress.com.ar;
|
||||
|
||||
location / {
|
||||
proxy_pass http://localhost:3005;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection 'upgrade';
|
||||
proxy_set_header Host $host;
|
||||
proxy_cache_bypass $http_upgrade;
|
||||
}
|
||||
}
|
||||
|
||||
cd /etc/nginx/sites-enabled/
|
||||
|
||||
ln -s /etc/nginx/sites-available/wap1.turnosxpress.com.ar wap1.turnosxpress.com.ar
|
||||
|
||||
nginx -t
|
||||
|
||||
service nginx restart
|
||||
service nginx status
|
||||
|
||||
sudo apt install certbot python3-certbot-nginx -y
|
||||
|
||||
certbot --nginx -d wap1.turnosxpress.com.ar
|
||||
@@ -0,0 +1,84 @@
|
||||
version: "3.8"
|
||||
|
||||
services:
|
||||
mongodb:
|
||||
image: mongo:4.2.14
|
||||
container_name: mongodb
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
MONGO_INITDB_ROOT_USERNAME: root
|
||||
MONGO_INITDB_ROOT_PASSWORD: frx8us2w
|
||||
MONGO_INITDB_DATABASE: turnosxpress
|
||||
volumes:
|
||||
- ./mongo-init.js:/docker-entrypoint-initdb.d/mongo-init.js:ro
|
||||
ports:
|
||||
- 192.168.1.61:27017:27017
|
||||
networks:
|
||||
- internal
|
||||
|
||||
bot-admin-api:
|
||||
image: bot-admin-api
|
||||
container_name: bot-admin-api
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
ports:
|
||||
- 3005:3005
|
||||
networks:
|
||||
- internal
|
||||
|
||||
turnosxpress:
|
||||
image: turnosxpress
|
||||
container_name: turnosxpress
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- 3000:3000
|
||||
- 3021:3021
|
||||
- 3001:3001
|
||||
extra_hosts:
|
||||
- "api.tx.local:192.168.1.61"
|
||||
volumes:
|
||||
- /home/horacio/tx-data/uploads:/app/server/build/uploads
|
||||
networks:
|
||||
- internal
|
||||
|
||||
file-server:
|
||||
image: file-server
|
||||
container_name: file-server
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- 4000:4000
|
||||
networks:
|
||||
- internal
|
||||
|
||||
backup:
|
||||
image: backupper
|
||||
container_name: backupper
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
- mongodb
|
||||
volumes:
|
||||
- /home/horacio/tx-data/uploads:/data-uploads # comparte los datos de la app
|
||||
- /root/hdr/tx-data/backups:/backup # guarda los .tar.gz y dumps
|
||||
- /root/hdr/tx-data/rclone:/root/.config/rclone # config de rclone
|
||||
networks:
|
||||
- internal
|
||||
|
||||
notifications:
|
||||
image: notification-sender
|
||||
container_name: notifications
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
- mongodb
|
||||
volumes:
|
||||
- /root/hdr/tx-data/notification-logs:/app/logs # carpeta externa para logs
|
||||
environment:
|
||||
NODE_NO_WARNINGS: 1
|
||||
DOTENV_DISABLE_TELEMETRY: 1
|
||||
networks:
|
||||
- internal
|
||||
|
||||
networks:
|
||||
internal:
|
||||
name: txlocal_internal
|
||||
driver: bridge
|
||||
@@ -0,0 +1,12 @@
|
||||
db = db.getSiblingDB("turnosxpress"); // selecciona o crea la base de datos 'midb'
|
||||
|
||||
db.createUser({
|
||||
user: "horacio",
|
||||
pwd: "frx8us2w",
|
||||
roles: [
|
||||
{
|
||||
role: "readWrite",
|
||||
db: "turnosxpress",
|
||||
},
|
||||
],
|
||||
});
|
||||
@@ -0,0 +1,14 @@
|
||||
server {
|
||||
server_name api.tx.local;
|
||||
|
||||
location / {
|
||||
proxy_pass http://localhost:3000;
|
||||
client_max_body_size 5M;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection 'upgrade';
|
||||
proxy_set_header Host $host;
|
||||
proxy_cache_bypass $http_upgrade;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
server {
|
||||
server_name chat.tx.local;
|
||||
|
||||
location / {
|
||||
proxy_pass http://localhost:3001;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection 'upgrade';
|
||||
proxy_set_header Host $host;
|
||||
proxy_cache_bypass $http_upgrade;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
server {
|
||||
server_name tx.local;
|
||||
|
||||
# Sitio web de Produccion
|
||||
location / {
|
||||
proxy_pass http://localhost:3021;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection 'upgrade';
|
||||
proxy_set_header Host $host;
|
||||
client_max_body_size 5M;
|
||||
proxy_cache_bypass $http_upgrade;
|
||||
}
|
||||
|
||||
# Sitio web de Mantenimiento
|
||||
#location / {
|
||||
# root /var/www/working-web;
|
||||
# index index.html;
|
||||
# try_files $uri $uri/ /index.html;
|
||||
# #Desactivar caché en los navegadores
|
||||
# add_header Cache-Control "no-store, no-cache, must-revalidate, max-age=0";
|
||||
# add_header Pragma "no-cache" always;
|
||||
# add_header Expires 0 always;
|
||||
#}
|
||||
}
|
||||
Reference in New Issue
Block a user