aggiunto supporto per il ridimensionamento della finestra e configurazione Docker per il deployment
Some checks are pending
Deploy in Produzione / deploy (push) Waiting to run
Some checks are pending
Deploy in Produzione / deploy (push) Waiting to run
This commit is contained in:
18
.gitea/workflows/deploy.yaml
Normal file
18
.gitea/workflows/deploy.yaml
Normal file
@@ -0,0 +1,18 @@
|
||||
name: Deploy in Produzione
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout del codice
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Deploy con Docker Compose
|
||||
run: |
|
||||
# Spegne i container vecchi e riaccende i nuovi (ricreandoli se l'immagine è cambiata)
|
||||
docker compose down --remove-orphans
|
||||
docker compose up -d --build
|
||||
|
||||
- name: Pulizia
|
||||
run: docker system prune -f # Rimuove immagini vecchie per non riempire il disco
|
||||
17
Dockerfile
Normal file
17
Dockerfile
Normal file
@@ -0,0 +1,17 @@
|
||||
# FASE 1: Build (Node.js)
|
||||
FROM node:lts-alpine as build-stage
|
||||
WORKDIR /app
|
||||
COPY package*.json ./
|
||||
RUN npm install
|
||||
COPY . .
|
||||
# Verifica che il comando nel package.json sia "build"
|
||||
RUN npm run build
|
||||
|
||||
# FASE 2: Produzione (Nginx)
|
||||
FROM nginx:stable-alpine as production-stage
|
||||
# Copia la configurazione custom di Nginx (vedi file successivo)
|
||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||
# Copia i file compilati dalla cartella dist (di solito è /dist)
|
||||
COPY --from=build-stage /app/dist /usr/share/nginx/html
|
||||
EXPOSE 80
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
19
docker-compose.yml
Normal file
19
docker-compose.yml
Normal file
@@ -0,0 +1,19 @@
|
||||
version: "3"
|
||||
|
||||
services:
|
||||
webapp:
|
||||
image: nginx:alpine # O la tua immagine custom
|
||||
container_name: infissionline_webapp
|
||||
restart: always
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
# Qui definisci il dominio!
|
||||
- "traefik.http.routers.infissionline.rule=Host(`infissionline-test.com`)"
|
||||
- "traefik.http.routers.infissionline.entrypoints=websecure"
|
||||
- "traefik.http.routers.infissionline.tls.certresolver=myresolver"
|
||||
networks:
|
||||
- web_proxy
|
||||
|
||||
networks:
|
||||
web_proxy:
|
||||
external: true
|
||||
@@ -531,7 +531,7 @@ body {
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 666px) {
|
||||
@media (max-width: 1108px) {
|
||||
|
||||
.mobile-popup {
|
||||
display: block;
|
||||
|
||||
@@ -27,6 +27,9 @@ const MenuBuilder = {
|
||||
vetri: data_vetri
|
||||
}
|
||||
|
||||
window.addEventListener('orientationchange', () => {
|
||||
location.reload();
|
||||
});
|
||||
PriceCalculator.init(price_data);
|
||||
let template_file = params.template != null ? params.template : 'menu.html';
|
||||
let template = await fetch(`./assets/_${template_file}?rnd=${Math.random()}`);
|
||||
@@ -39,8 +42,9 @@ const MenuBuilder = {
|
||||
container.innerHTML = template;
|
||||
|
||||
let isMobile = window.innerWidth <= 1108;
|
||||
|
||||
console.log("is mobile", isMobile);
|
||||
if (isMobile && window.innerWidth < window.innerHeight) {
|
||||
console.log('Mobile portrait mode setup');
|
||||
const menuHeader = $('.menu-categorie').html();
|
||||
const opzioniMenu = $('.opzioni-mobile-menu').html();
|
||||
$('#menu-mobile').append(menuHeader);
|
||||
@@ -110,7 +114,8 @@ const MenuBuilder = {
|
||||
|
||||
$('.menu-scroll').height(window.innerHeight - hMisure);
|
||||
} else {
|
||||
container = document.querySelector('.mobile-popup');
|
||||
if(window.innerWidth < window.innerHeight)
|
||||
container = document.querySelector('.mobile-popup');
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user