From fa1165558beb886218e52ba875777efdc6472ac0 Mon Sep 17 00:00:00 2001 From: Grzegorz Kucmierz Date: Sun, 1 Mar 2026 07:15:17 +0000 Subject: [PATCH] feat: Add Docker config, Gitea workflow, and map improvements - Add Dockerfile, nginx.conf, docker-compose.yml - Add Gitea Actions workflow - Improve map mobile UX (safe area, no pull-to-refresh) - Persist map state (zoom, center, layer) to localStorage - Add Google Hybrid map layer - Configure Vite for Cloudflare tunnel --- .dockerignore | 5 + .gitea/workflows/docker-build.yml | 18 +++ Dockerfile | 20 ++++ docker-compose.yml | 13 +++ index.html | 2 +- nginx.conf | 15 +++ src/App.vue | 3 +- src/components/Map.vue | 183 ++++++++++++++++++++++++++++-- src/style.css | 13 ++- vite.config.js | 9 ++ 10 files changed, 267 insertions(+), 14 deletions(-) create mode 100644 .dockerignore create mode 100644 .gitea/workflows/docker-build.yml create mode 100644 Dockerfile create mode 100644 docker-compose.yml create mode 100644 nginx.conf diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..e104fa5 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +node_modules +dist +.git +.vscode +.DS_Store diff --git a/.gitea/workflows/docker-build.yml b/.gitea/workflows/docker-build.yml new file mode 100644 index 0000000..d657a63 --- /dev/null +++ b/.gitea/workflows/docker-build.yml @@ -0,0 +1,18 @@ +name: Docker Image CI + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Build the Docker image + run: docker build . --file Dockerfile --tag my-image-name:$(date +%s) diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..de2b969 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,20 @@ +# Stage 1: Build the Vue application +FROM node:lts-alpine as build-stage + +WORKDIR /app + +COPY package*.json ./ +RUN npm install + +COPY . . +RUN npm run build + +# Stage 2: Serve the application with Nginx +FROM nginx:stable-alpine as production-stage + +COPY --from=build-stage /app/dist /usr/share/nginx/html +COPY nginx.conf /etc/nginx/conf.d/default.conf + +EXPOSE 80 + +CMD ["nginx", "-g", "daemon off;"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..7bf2426 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,13 @@ +version: '3' +services: + geo-words: + build: . + ports: + - "3002:80" + restart: always + networks: + - npm_public + +networks: + npm_public: + external: true diff --git a/index.html b/index.html index bd63f78..c335d4b 100644 --- a/index.html +++ b/index.html @@ -3,7 +3,7 @@ - + Geo Words diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..40b9650 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,15 @@ +server { + listen 80; + server_name localhost; + + location / { + root /usr/share/nginx/html; + index index.html index.htm; + try_files $uri $uri/ /index.html; + } + + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } +} diff --git a/src/App.vue b/src/App.vue index 7323744..dcb3180 100644 --- a/src/App.vue +++ b/src/App.vue @@ -11,7 +11,8 @@ import Map from './components/Map.vue'; diff --git a/src/style.css b/src/style.css index 79addf0..3a11d6b 100644 --- a/src/style.css +++ b/src/style.css @@ -13,14 +13,21 @@ -moz-osx-font-smoothing: grayscale; } -body { +html, body { margin: 0; + padding: 0; + width: 100%; + height: 100%; + overscroll-behavior: none; /* Zapobiega "pull-to-refresh" na mobilkach */ +} + +body { display: flex; - place-items: start; /* Changed from center */ + place-items: start; min-width: 320px; - min-height: 100vh; } #app { width: 100%; + height: 100%; } diff --git a/vite.config.js b/vite.config.js index bbcf80c..9c9f0fc 100644 --- a/vite.config.js +++ b/vite.config.js @@ -4,4 +4,13 @@ import vue from '@vitejs/plugin-vue' // https://vite.dev/config/ export default defineConfig({ plugins: [vue()], + server: { + host: true, + allowedHosts: true, + headers: { + 'Cache-Control': 'no-store, no-cache, must-revalidate, proxy-revalidate', + 'Pragma': 'no-cache', + 'Expires': '0', + } + } })