From c4e11d68289c03240371096aa084b22ea912c84f Mon Sep 17 00:00:00 2001 From: leo <426742@gmail.com> Date: Fri, 9 Aug 2024 07:13:04 +0500 Subject: [PATCH] add docker --- Dockerfile | 3 +++ README.md | 14 ++++++++++++-- docker-compose.yml | 18 ++++++++++++++++++ {Sounds => html/Sounds}/mr_9999_00.wav | Bin {Sounds => html/Sounds}/mr_9999_01.wav | Bin {Sounds => html/Sounds}/mr_9999_02.wav | Bin {Sounds => html/Sounds}/mr_9999_03.wav | Bin {Sounds => html/Sounds}/mr_9999_04.wav | Bin {Sounds => html/Sounds}/mr_9999_05.wav | Bin {Sounds => html/Sounds}/mr_9999_06.wav | Bin {Sounds => html/Sounds}/mr_9999_07.wav | Bin {Sounds => html/Sounds}/mr_9999_08.wav | Bin {Sounds => html/Sounds}/mr_9999_09.wav | Bin {Sounds => html/Sounds}/mr_9999_10.wav | Bin {Sounds => html/Sounds}/mr_9999_11.wav | Bin {Sounds => html/Sounds}/mr_9999_12.wav | Bin {Sounds => html/Sounds}/mr_9999_13.wav | Bin {Sounds => html/Sounds}/mr_9999_14.wav | Bin {Sounds => html/Sounds}/mr_9999_15.wav | Bin {background => html/background}/food.webp | Bin .../background}/footer_lodyas.png | Bin .../background}/geometry2.webp | Bin .../background}/restaurant_icons.webp | Bin .../background}/use_your_illusion.webp | Bin .../digital-7-italic.ttf | Bin favicon.png => html/favicon.png | Bin index.html => html/index.html | 0 main.js => html/main.js | 0 28 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 Dockerfile create mode 100644 docker-compose.yml rename {Sounds => html/Sounds}/mr_9999_00.wav (100%) rename {Sounds => html/Sounds}/mr_9999_01.wav (100%) rename {Sounds => html/Sounds}/mr_9999_02.wav (100%) rename {Sounds => html/Sounds}/mr_9999_03.wav (100%) rename {Sounds => html/Sounds}/mr_9999_04.wav (100%) rename {Sounds => html/Sounds}/mr_9999_05.wav (100%) rename {Sounds => html/Sounds}/mr_9999_06.wav (100%) rename {Sounds => html/Sounds}/mr_9999_07.wav (100%) rename {Sounds => html/Sounds}/mr_9999_08.wav (100%) rename {Sounds => html/Sounds}/mr_9999_09.wav (100%) rename {Sounds => html/Sounds}/mr_9999_10.wav (100%) rename {Sounds => html/Sounds}/mr_9999_11.wav (100%) rename {Sounds => html/Sounds}/mr_9999_12.wav (100%) rename {Sounds => html/Sounds}/mr_9999_13.wav (100%) rename {Sounds => html/Sounds}/mr_9999_14.wav (100%) rename {Sounds => html/Sounds}/mr_9999_15.wav (100%) rename {background => html/background}/food.webp (100%) rename {background => html/background}/footer_lodyas.png (100%) rename {background => html/background}/geometry2.webp (100%) rename {background => html/background}/restaurant_icons.webp (100%) rename {background => html/background}/use_your_illusion.webp (100%) rename digital-7-italic.ttf => html/digital-7-italic.ttf (100%) rename favicon.png => html/favicon.png (100%) rename index.html => html/index.html (100%) rename main.js => html/main.js (100%) diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..12a719d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,3 @@ +FROM nginx:1.27.0-alpine3.19 + +COPY html /usr/share/nginx/html \ No newline at end of file diff --git a/README.md b/README.md index 6a9146f..4ec692c 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,13 @@ -## My first game Tetris +## Tetris game -Optimized for Firefox mobile for android \ No newline at end of file +Optimized for Firefox mobile for android + +*docker configuration* + +`docker-compose build` +`docker-compose up -d` + +Start: `sudo docker start tetris` +Start `sudo docker compose -f /data/tetris/docker-compose.yml up -d` + +Stop: `sudo docker stop tetris` \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..425a712 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,18 @@ +services: + nginx: + container_name: tetris + build: + context: . + restart: always + networks: + - proxynet + labels: + - "traefik.enable=true" + - "traefik.http.routers.nginx.rule=Host(`tetris.${SERVER_DOMAIN}`)" + # For dev: + volumes: + - ./html:/usr/share/nginx/html + +networks: + proxynet: + external: true \ No newline at end of file diff --git a/Sounds/mr_9999_00.wav b/html/Sounds/mr_9999_00.wav similarity index 100% rename from Sounds/mr_9999_00.wav rename to html/Sounds/mr_9999_00.wav diff --git a/Sounds/mr_9999_01.wav b/html/Sounds/mr_9999_01.wav similarity index 100% rename from Sounds/mr_9999_01.wav rename to html/Sounds/mr_9999_01.wav diff --git a/Sounds/mr_9999_02.wav b/html/Sounds/mr_9999_02.wav similarity index 100% rename from Sounds/mr_9999_02.wav rename to html/Sounds/mr_9999_02.wav diff --git a/Sounds/mr_9999_03.wav b/html/Sounds/mr_9999_03.wav similarity index 100% rename from Sounds/mr_9999_03.wav rename to html/Sounds/mr_9999_03.wav diff --git a/Sounds/mr_9999_04.wav b/html/Sounds/mr_9999_04.wav similarity index 100% rename from Sounds/mr_9999_04.wav rename to html/Sounds/mr_9999_04.wav diff --git a/Sounds/mr_9999_05.wav b/html/Sounds/mr_9999_05.wav similarity index 100% rename from Sounds/mr_9999_05.wav rename to html/Sounds/mr_9999_05.wav diff --git a/Sounds/mr_9999_06.wav b/html/Sounds/mr_9999_06.wav similarity index 100% rename from Sounds/mr_9999_06.wav rename to html/Sounds/mr_9999_06.wav diff --git a/Sounds/mr_9999_07.wav b/html/Sounds/mr_9999_07.wav similarity index 100% rename from Sounds/mr_9999_07.wav rename to html/Sounds/mr_9999_07.wav diff --git a/Sounds/mr_9999_08.wav b/html/Sounds/mr_9999_08.wav similarity index 100% rename from Sounds/mr_9999_08.wav rename to html/Sounds/mr_9999_08.wav diff --git a/Sounds/mr_9999_09.wav b/html/Sounds/mr_9999_09.wav similarity index 100% rename from Sounds/mr_9999_09.wav rename to html/Sounds/mr_9999_09.wav diff --git a/Sounds/mr_9999_10.wav b/html/Sounds/mr_9999_10.wav similarity index 100% rename from Sounds/mr_9999_10.wav rename to html/Sounds/mr_9999_10.wav diff --git a/Sounds/mr_9999_11.wav b/html/Sounds/mr_9999_11.wav similarity index 100% rename from Sounds/mr_9999_11.wav rename to html/Sounds/mr_9999_11.wav diff --git a/Sounds/mr_9999_12.wav b/html/Sounds/mr_9999_12.wav similarity index 100% rename from Sounds/mr_9999_12.wav rename to html/Sounds/mr_9999_12.wav diff --git a/Sounds/mr_9999_13.wav b/html/Sounds/mr_9999_13.wav similarity index 100% rename from Sounds/mr_9999_13.wav rename to html/Sounds/mr_9999_13.wav diff --git a/Sounds/mr_9999_14.wav b/html/Sounds/mr_9999_14.wav similarity index 100% rename from Sounds/mr_9999_14.wav rename to html/Sounds/mr_9999_14.wav diff --git a/Sounds/mr_9999_15.wav b/html/Sounds/mr_9999_15.wav similarity index 100% rename from Sounds/mr_9999_15.wav rename to html/Sounds/mr_9999_15.wav diff --git a/background/food.webp b/html/background/food.webp similarity index 100% rename from background/food.webp rename to html/background/food.webp diff --git a/background/footer_lodyas.png b/html/background/footer_lodyas.png similarity index 100% rename from background/footer_lodyas.png rename to html/background/footer_lodyas.png diff --git a/background/geometry2.webp b/html/background/geometry2.webp similarity index 100% rename from background/geometry2.webp rename to html/background/geometry2.webp diff --git a/background/restaurant_icons.webp b/html/background/restaurant_icons.webp similarity index 100% rename from background/restaurant_icons.webp rename to html/background/restaurant_icons.webp diff --git a/background/use_your_illusion.webp b/html/background/use_your_illusion.webp similarity index 100% rename from background/use_your_illusion.webp rename to html/background/use_your_illusion.webp diff --git a/digital-7-italic.ttf b/html/digital-7-italic.ttf similarity index 100% rename from digital-7-italic.ttf rename to html/digital-7-italic.ttf diff --git a/favicon.png b/html/favicon.png similarity index 100% rename from favicon.png rename to html/favicon.png diff --git a/index.html b/html/index.html similarity index 100% rename from index.html rename to html/index.html diff --git a/main.js b/html/main.js similarity index 100% rename from main.js rename to html/main.js