From 87d5b54e19982975aa7026b1e8af58429bfcd971 Mon Sep 17 00:00:00 2001 From: MotorTruck1221 Date: Sat, 21 Dec 2024 05:06:47 -0700 Subject: [PATCH] Docker shit AGAIN --- .gitignore | 2 -- Dockerfile | 3 +- config.example.toml | 5 ++++ docker-builds.yml | 59 ++++++++++++++++++++++++++++++++++++++++ docker-compose.build.yml | 7 ++++- docker-compose.yml | 7 ++++- 6 files changed, 78 insertions(+), 5 deletions(-) create mode 100644 docker-builds.yml diff --git a/.gitignore b/.gitignore index 013ee4fba..543d3d1fd 100644 --- a/.gitignore +++ b/.gitignore @@ -30,5 +30,3 @@ config.toml # Stupidness ~/ -# Docker files that aren't needed in the real repo -docker-compose.local.yml diff --git a/Dockerfile b/Dockerfile index 383117f4c..9b09a82ff 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,11 +6,12 @@ COPY package*.json . COPY deno.jsonc . COPY . . +ARG SEO RUN apt update RUN apt install -y python3 python3-pip libssl-dev build-essential python3-dev nodejs RUN cp -n config.example.toml config.toml RUN deno install --allow-scripts -RUN deno task build +RUN if [ -z "$SEO" ]; then deno task build; else deno task build:seo; fi RUN export TERM=xterm-256color ENV PORT="8000" VOLUME /app diff --git a/config.example.toml b/config.example.toml index d73d00f9b..45627851b 100644 --- a/config.example.toml +++ b/config.example.toml @@ -4,3 +4,8 @@ games = true [server] wisp = true port = 8000 + +[seo] +enabled = false +both = false +domain = "http://localhost:8000" diff --git a/docker-builds.yml b/docker-builds.yml new file mode 100644 index 000000000..7a1b6cb23 --- /dev/null +++ b/docker-builds.yml @@ -0,0 +1,59 @@ +version: '3' + +# This file is for building the docker images and pushing them to the registry. You can safely ignore this + +services: + incognito: + image: motortruck1221/incognito:latest + build: + context: . + dockerfile: Dockerfile + container_name: incognito + restart: unless-stopped + ports: + - '8081:8000' + volumes: + - ./config.toml:/app/config.toml + incognito-versioned: + image: motortruck1221/incognito:1.1.3 + build: + context: . + dockerfile: Dockerfile + container_name: incognito + restart: unless-stopped + ports: + - '8081:8000' + volumes: + - ./config.toml:/app/config.toml + incognito-seo: + image: motortruck1221/incognito:latest-seo + build: + context: . + dockerfile: Dockerfile + args: + - SEO=true + container_name: incognito + restart: unless-stopped + ports: + - '8081:8000' + environment: + - SEO=true + - BOTH=true + volumes: + - ./config.toml:/app/config.toml + incognito-seo-versioned: + image: motortruck1221/incognito:1.1.3-seo + build: + context: . + dockerfile: Dockerfile + args: + - SEO=true + container_name: incognito + restart: unless-stopped + ports: + - '8081:8000' + environment: + - SEO=true + - BOTH=true + volumes: + - ./config.toml:/app/config.toml diff --git a/docker-compose.build.yml b/docker-compose.build.yml index 09b733e1c..3fe27e525 100644 --- a/docker-compose.build.yml +++ b/docker-compose.build.yml @@ -12,7 +12,12 @@ services: # The ports work like this: Host:Container (DO NOT MODIFY THE CONTAINER PORT) - '8081:8000' volumes: - - ./config.toml:/app/config.toml + - ./config.toml:/app/config.toml # this can be removed if you need the image to be stateless + #environment: + # - SEO=false - Enabled to turn on SEO in the build + # - BOTH=false - Use if you want both the SEO and non-seo versions + # - DOMAIN=https://incog.works - Use if you want SEO (when using the both option) to work properly + # The below allows you to change any of the `buildOpts` config options and use them. #command: # - bstart - Use if using Fastify diff --git a/docker-compose.yml b/docker-compose.yml index 542894a7d..63150404c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,7 +9,12 @@ services: # The ports work like this: Host:Container (DO NOT MODIFY THE CONTAINER PORT) - '8081:8000' volumes: - - ./config.toml:/app/config.toml + - ./config.toml:/app/config.toml # This can be removed if you need the image to be stateless + #environment: + # - SEO=false - Enabled to turn on SEO in the build + # - BOTH=false - Use if you want both the SEO and non-seo versions + # - DOMAIN=https://incog.works - Use if you want SEO (when using the both option) to work properly + # The below allows you to change any of the `buildOpts` config options and use them. #command: # - bstart - Use if using Fastify