diff --git a/redirect/.arch b/redirect/.arch new file mode 100644 index 0000000..6d200f2 --- /dev/null +++ b/redirect/.arch @@ -0,0 +1 @@ +linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8,linux/ppc64le,linux/s390x diff --git a/redirect/.version b/redirect/.version new file mode 100644 index 0000000..0ec25f7 --- /dev/null +++ b/redirect/.version @@ -0,0 +1 @@ +v1.0.0 diff --git a/redirect/Dockerfile b/redirect/Dockerfile new file mode 100644 index 0000000..8657441 --- /dev/null +++ b/redirect/Dockerfile @@ -0,0 +1,16 @@ +FROM nginx:stable-alpine3.20 +LABEL maintainer="Tech Thinker " + +ENV REDIRECT_URL 'https://hub.docker.com/r/techthinkerorg/redirect' + +WORKDIR /app +# Copy the template for runtime substitution +COPY nginx.conf /app/nginx.conf +COPY entrypoint.sh /app/entrypoint.sh + +RUN apk add --no-cache gettext +RUN chmod +x /app/entrypoint.sh + +EXPOSE 3000 + +ENTRYPOINT ["/app/entrypoint.sh"] diff --git a/redirect/docker-compose.yaml b/redirect/docker-compose.yaml new file mode 100644 index 0000000..5f3bf0f --- /dev/null +++ b/redirect/docker-compose.yaml @@ -0,0 +1,9 @@ +version: "3.8" +services: + redirect: + build: + context: . + environment: + - REDIRECT_URL="https://asif.axiomwallet.com/admin" + ports: + - 8099:3000 diff --git a/redirect/entrypoint.sh b/redirect/entrypoint.sh new file mode 100755 index 0000000..0880064 --- /dev/null +++ b/redirect/entrypoint.sh @@ -0,0 +1,4 @@ +#!/bin/sh +sed -i "s|\${REDIRECT_URL}|$REDIRECT_URL|g" nginx.conf +cp nginx.conf /etc/nginx/conf.d/default.conf +nginx -g 'daemon off;' diff --git a/redirect/nginx.conf b/redirect/nginx.conf new file mode 100644 index 0000000..d154bd8 --- /dev/null +++ b/redirect/nginx.conf @@ -0,0 +1,8 @@ +server { + listen 3000; + server_name _; + + location / { + return 301 ${REDIRECT_URL}; + } +}