From 38e7a619213be090d39d856ec0156fa4c6dac4f7 Mon Sep 17 00:00:00 2001 From: Grant Slater Date: Sun, 15 Sep 2024 03:43:18 +0100 Subject: [PATCH] Add docker + builder --- .dockerignore | 9 + .editorconfig | 11 + .github/dependabot.yml | 6 + .github/workflows/ci.yml | 67 +++++++ Dockerfile | 22 ++ bday.json | 422 +++++++++++++++++++++++++++++++++++++++ docker-compose.yml | 8 + 7 files changed, 545 insertions(+) create mode 100644 .dockerignore create mode 100644 .editorconfig create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/ci.yml create mode 100644 Dockerfile create mode 100644 bday.json create mode 100644 docker-compose.yml diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..5e12ef6 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,9 @@ +# Ignore git metadata folder +.git/ +.github/ + +# Ignore docker related files +Dockerfile* +docker-compose.* +.dockerignore +.gitignore diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..c0d0101 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,11 @@ +# EditorConfig is awesome: https://EditorConfig.org + +root = true + +[*] +charset = utf-8 +indent_style = space +trim_trailing_whitespace = true +insert_final_newline = true +end_of_line = lf +indent_size = 2 diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..5ace460 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..d35d24e --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,67 @@ +name: ci + +on: + push: + branches: + - '**' + - '!dependabot/**' + tags: + - 'v*.*.*' + pull_request: + branches: + - 'master' + - 'main' + - 'gh-pages' + schedule: + - cron: '25 3 */7 * *' + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-{{ github.head_ref || github.ref }} + cancel-in-progress: true + +jobs: + docker: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/${{ github.repository }} + tags: | + type=ref,event=branch + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}} + type=raw,value=latest,enable={{is_default_branch}} + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to GitHub Container Registry + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v6 + with: + context: . + file: Dockerfile + platforms: linux/amd64,linux/arm64 + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..d695d9c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,22 @@ +FROM docker.io/debian:12 AS build + +COPY . /app/_site + +RUN find /app/_site/ -type f \( -name "*.html" -o -name "*.css" -o -name "*.js" -o -name "*.xml" -o -name "*.json" -o -name "*.svg" \) -print0 | xargs -0 -P4 gzip -9k + +# https://github.com/nginxinc/docker-nginx-unprivileged +FROM ghcr.io/nginxinc/nginx-unprivileged:stable-alpine AS webserver + +RUN echo "absolute_redirect off;" >/etc/nginx/conf.d/no-absolute_redirect.conf +RUN echo "gzip_static on; gzip_proxied any;" >/etc/nginx/conf.d/gzip_static.conf +# brotli_static not yet available in standard nginx distribution +# RUN echo "brotli_static on; brotli_proxied any;" >/etc/nginx/conf.d/brotli_static.conf + +# Copy built site from build stage +COPY --from=build /app/_site /usr/share/nginx/html + +# Test configuration during docker build +RUN nginx -t + +# Port the container will listen on +EXPOSE 8080 \ No newline at end of file diff --git a/bday.json b/bday.json new file mode 100644 index 0000000..e3be302 --- /dev/null +++ b/bday.json @@ -0,0 +1,422 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {"name":"OSM Day Celebration and Open Tech Meetup
August 9. organized by Kathmandu University Open Source Community at Kathmandu University in Nepal"}, + "geometry": { + "coordinates": [ + 85.53735, + 27.61870 + ], + "type": "Point" + } + }, + { + "type": "Feature", + "properties": {"name":"20 years with OSM
August 10. Ardagani Restaurant on Pirosmani at 18 local time"}, + "geometry": { + "coordinates": [ + 41.61901, + 41.64161 + ], + "type": "Point" + } + }, + { + "type": "Feature", + "properties": {"name":"OpenStreetMap Training organised by Kathmandu Living Labs
August 9 at Nepal Banepa Polytechnic Institute in Nepal"}, + "geometry": { + "coordinates": [ + 85.52310, + 27.63524 + ], + "type": "Point" + } + }, + { + "type": "Feature", + "properties": {"name":"OpenStreetMap 20th Anniversary and Mapping party
August 9/10/11 at KL University Vijayawada, Andhra Pradesh, India"}, + "geometry": { + "coordinates": [ + 80.62397, + 6.44240 + ], + "type": "Point" + } + }, + { + "type": "Feature", + "properties": {"name":"OpenStreetMap Turkiye Monthly Mapathon
August 9 Online, starting at 8PM (UTC+3)"}, + "geometry": { + "coordinates": [ + 35.192, + 39.126 + ], + "type": "Point" + } + }, + { + "type": "Feature", + "properties": {"name":"OpenStreetMap 20th Anniversary Celebration
August 9 at OpenMap Development Tanzania (OMDTZ) office and online"}, + "geometry": { + "coordinates": [ + 39.17863, + -6.74180 + ], + "type": "Point" + } + }, + { + "type": "Feature", + "properties": {"name":"OSM Seattle 20th Anniversary Picnic
August 10 at Green Lake Park, Seattle"}, + "geometry": { + "coordinates": [ + -122.3364, + 47.6777 + ], + "type": "Point" + } + }, + { + "type": "Feature", + "properties": {"name":"20th Anniversary Meetup
August 10 at the NextGIS office at 16:00."}, + "geometry": { + "coordinates": [ + 37.66199, + 55.77107 + ], + "type": "Point" + } + }, + { + "type": "Feature", + "properties": {"name":"OpenStreetMap 20歳のお祝いでOSMケーキ作ります!
August 5 at Furuhashi Lab. ANNEX, Yokoze Town, organized by MAPconcierge YouthMappers AGU"}, + "geometry": { + "coordinates": [ + 139.1069, + 35.98180 + ], + "type": "Point" + } + }, + { + "type": "Feature", + "properties": {"name":"Missing Maps London mapathon
August 6 organized by Missing Maps London - Online event"}, + "geometry": { + "coordinates": [ + -0.0882, + 51.4898 + ], + "type": "Point" + } + }, + { + "type": "Feature", + "properties": {"name":"GeoBeer at BeeЯ on Centro Comercial Gran Estación en Bogotá
August 9"}, + "geometry": { + "coordinates": [ + -74.10197, + 4.64782 + ], + "type": "Point" + } + }, + { + "type": "Feature", + "properties": {"name":"OpenStreetMap 20th Anniversary Celebration
August 9 At OpenStreetMap Uganda offices, Plot 351, Kyadondo, Mengo, Kiwatule starting at 8AM EAT"}, + "geometry": { + "coordinates": [ + 32.62377, + 0.35803 + ], + "type": "Point" + } + }, + { + "type": "Feature", + "properties": {"name":"Virtual beer for the 20 years at OSMvideo in LatAm group.
August 10"}, + "geometry": { + "coordinates": [ + -58.36, + -21.21 + ], + "type": "Point" + } + }, + { + "type": "Feature", + "properties": {"name":"Albania OpenStreetMap Online Mapping Party
August 10"}, + "geometry": { + "coordinates": [ + 20.462, + 41.096 + ], + "type": "Point" + } + }, + { + "type": "Feature", + "properties": {"name":"srilanka OpenStreetMap 20th Anniversary Party - Eastern University
August 11"}, + "geometry": { + "coordinates": [ + 81.21269, + 8.65462 + ], + "type": "Point" + } + }, + { + "type": "Feature", + "properties": {"name":"Indonesia Welcoming party and celebrate OSM 20th Anniversary
August 11, powered by UPI YouthMappers - at Universitas Pendidikan Indonesia, Bandung"}, + "geometry": { + "coordinates": [ + 107.59180, + -6.86114 + ], + "type": "Point" + } + }, + { + "type": "Feature", + "properties": {"name":"apéro pour fêter l'anniversaire d'OpenStreetMap at Rouen
August 9"}, + "geometry": { + "coordinates": [ + 1.10111, + 49.44269 + ], + "type": "Point" + } + }, + { + "type": "Feature", + "properties": {"name":"Tanzania OpenStreetMap 20th Anniversary Birthday Mapping Party
August 9, organized by GeoTE-Tanzania in Collaboration with YouthMappers chapter in Tanzania"}, + "geometry": { + "coordinates": [ + 37.62885, + -6.79587 + ], + "type": "Point" + } + }, + { + "type": "Feature", + "properties": {"name":"Nigeria OpenStreetMap Birthday Pub
August 10, At the Unique Mappers Network Nigeria National Office and Virtually 7PM WAT"}, + "geometry": { + "coordinates": [ + 6.92194, + 4.90373 + ], + "type": "Point" + } + }, + { + "type": "Feature", + "properties": {"name":"Kosovo OpenStreetMap 20th Anniversary Party
August 9, Prishtina Hackerspace"}, + "geometry": { + "coordinates": [ + 21.16962, + 42.65612 + ], + "type": "Point" + } + }, + { + "type": "Feature", + "properties": {"name":"Australia Geogeeks celebrate 20 years of OpenStreetMap
09 August 2024 at 5:30PM at The Globe, Perth, Western Australia"}, + "geometry": { + "coordinates": [ + 115.85855, + -31.95162 + ], + "type": "Point" + } + }, + { + "type": "Feature", + "properties": {"name":"OpenStreetMap 20歳の誕生日会!
Friday, August 9, 2024, 18:30-22:30"}, + "geometry": { + "coordinates": [ + 135.61526, + 34.85277 + ], + "type": "Point" + } + }, + { + "type": "Feature", + "properties": {"name":"OpenStreetMap 20th Mapping Competition POI
Online competition period: 2 - 22 August 2024"}, + "geometry": { + "coordinates": [ + 117.896, + -2.496 + ], + "type": "Point" + } + }, + { + "type": "Feature", + "properties": {"name":"Iran Dona Celeberating OSM20th - Online event
Friday, August 19"}, + "geometry": { + "coordinates": [ + 53.683, + 32.620 + ], + "type": "Point" + } + }, + { + "type": "Feature", + "properties": {"name":" Germany 20th Anniversary Mapping Party des Code for Niederrhein, Moers
im Hackerspace des Jugendzentrums Nord in Moers Reepelen. Samstag, 10. August"}, + "geometry": { + "coordinates": [ + 6.60695, + 51.48944 + ], + "type": "Point" + } + }, + { + "type": "Feature", + "properties": {"name":"Bangladesh OpenStreetMap Turning Twenty Open Comunity Party in Dhaka City
Powered by YouthMappers Bangladesh Supported by Bangladesh Open Innovation Lab (BOIL). August 10."}, + "geometry": { + "coordinates": [ + 90.3890, + 23.7645 + ], + "type": "Point" + } + }, + { + "type": "Feature", + "properties": {"name":"OpenStreetMap 20th Anniversary Birthday party/Karlsruhe
Samstag, 10. August 2024 10:00 bis 18:00 Uhr. Geofabrik, Amalienstraße 44, 76133 Karlsruhe"}, + "geometry": { + "coordinates": [ + 8.39021, + 49.00961 + ], + "type": "Point" + } + }, + { + "type": "Feature", + "properties": {"name":"Stäffele-Mapping in Stuttgart
Aus diesem Anlass widmen wir uns der Erfassung der Stuttgarter Stäffele. Sonntag, 11. August 2024, ab 10:00. Stadtmessungsamt Stuttgart, Kronenstraße 20, 70161 Stuttgart"}, + "geometry": { + "coordinates": [ + 9.17888, + 48.78265 + ], + "type": "Point" + } + }, + { + "type": "Feature", + "properties": {"name":"Vendredi 9 août : apéro pour fêter l'anniversaire d'OpenStreetMap
rendez-vous à partir 18h au Gaspard, 2 rue de Lionne à Grenoble"}, + "geometry": { + "coordinates": [ + 5.72968, + 45.19376 + ], + "type": "Point" + } + }, + { + "type": "Feature", + "properties": {"name":"Poland Wikimaps User Group meetup and OpenStreetMap birthday party at Wikimania in Katowice
Friday, 9 August 12:15 – 13:15 local time or 10:15 - 11:15 UTC, 60 minutes, room 10 (M)"}, + "geometry": { + "coordinates": [ + 19.0271, + 50.2657 + ], + "type": "Point" + } + }, + { + "type": "Feature", + "properties": {"name":"OSM Utah 20th Birthday Happy Hour
August 9. The Local, Salt Lake City"}, + "geometry": { + "coordinates": [ + -111.88206, + 40.76038 + ], + "type": "Point" + } + }, + { + "type": "Feature", + "properties": {"name":"Democratic Republic of the Congo OpenStreetMap 20th Anniversary Party
August 9. Location : Orange Digital Center"}, + "geometry": { + "coordinates": [ + 15.30698, + -4.33104 + ], + "type": "Point" + } + }, + { + "type": "Feature", + "properties": {"name":"India OpenStreetMap Bengaluru Mapping Party
August 10. Location tbd"}, + "geometry": { + "coordinates": [ + 77.5900820, + 12.9767936 + ], + "type": "Point" + } + }, + { + "type": "Feature", + "properties": {"name":"India OpenStreetMap 20th Anniversary Birthday partyAugust 10. Location Public Library, Puzhakkal, Thrissur District
Location tbd"}, + "geometry": { + "coordinates": [ + 76.17539, + 10.55200 + ], + "type": "Point" + } + }, + { + "type": "Feature", + "properties": {"name":"祝!OpenStreetMap誕生20周年 夏の会津マッパ&お祝いパーティー!
Sat, 1:00 PM | 福島県会津若松市追手町1−1"}, + "geometry": { + "coordinates": [ + 139.93124, + 37.48799 + ], + "type": "Point" + } + }, + { + "type": "Feature", + "properties": {"name":"OpenStreetMap Birthday Geomob
On the evening of Wednesday 18th September we'll have very special #geomob event with all OpenStreetMap topics! Tocation tbd"}, + "geometry": { + "coordinates": [ + -0.07626,51.50825 + ], + "type": "Point" + } + }, + { + "type": "Feature", + "properties": {"name":"OpenStreetMap Birthday Pub
Saturday 10th August from midday onwards, we'll be celebrating the OpenStreetMap 20th Anniversary Birthday party at the Doggetts Coat & Badge pub on the South bank"}, + "geometry": { + "coordinates": [ + -0.1048, + 51.5085 + ], + "type": "Point" + } + }, + { + "type": "Feature", + "properties": {"name":"OSM-Stammtisch mit Grillevent zum Abschluss der Swiss OSM Jubilee Tour!
So. 11. August 2024, (Time tbd.), Location tbd"}, + "geometry": { + "coordinates": [ + 8.2241, + 46.8224 + ], + "type": "Point" + } + } + ] +} diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..b35190f --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,8 @@ +services: + + app: + build: + context: . + dockerfile: Dockerfile + ports: + - 8080:8080