Skip to content

Commit

Permalink
redirect image added
Browse files Browse the repository at this point in the history
  • Loading branch information
mrasif committed Nov 15, 2024
1 parent 29a124f commit f55e5ac
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 0 deletions.
1 change: 1 addition & 0 deletions redirect/.arch
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8,linux/ppc64le,linux/s390x
1 change: 1 addition & 0 deletions redirect/.version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v1.0.0
16 changes: 16 additions & 0 deletions redirect/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM nginx:stable-alpine3.20
LABEL maintainer="Tech Thinker <https://techthinker.js.org>"

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"]
9 changes: 9 additions & 0 deletions redirect/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: "3.8"
services:
redirect:
build:
context: .
environment:
- REDIRECT_URL="https://asif.axiomwallet.com/admin"
ports:
- 8099:3000
4 changes: 4 additions & 0 deletions redirect/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -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;'
8 changes: 8 additions & 0 deletions redirect/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
server {
listen 3000;
server_name _;

location / {
return 301 ${REDIRECT_URL};
}
}

0 comments on commit f55e5ac

Please sign in to comment.