diff --git a/cmd/preview/Dockerfile b/cmd/preview/Dockerfile index 93a3fc0..9b8ebd9 100644 --- a/cmd/preview/Dockerfile +++ b/cmd/preview/Dockerfile @@ -1,6 +1,9 @@ FROM alpine:3.16.3 +RUN apk add --no-cache git WORKDIR / +COPY init.sh /init.sh +RUN chmod +x /init.sh COPY preview /preview -RUN ls -la RUN chmod +x /preview -ENTRYPOINT ["/preview"] \ No newline at end of file +RUN ls -la +ENTRYPOINT ["/init.sh"] \ No newline at end of file diff --git a/cmd/preview/docker-compose.yml b/cmd/preview/docker-compose.yml index fd79d0b..770f87c 100644 --- a/cmd/preview/docker-compose.yml +++ b/cmd/preview/docker-compose.yml @@ -11,7 +11,6 @@ services: - CF_TUNNEL_TOKEN restart: unless-stopped redis: - # name: redis-stack image: redis/redis-stack:latest ports: - 6379:6379 @@ -27,16 +26,15 @@ services: - rod build: context: . - # volumes: - # - /home/srliao/code/assets/assets:/assets environment: - PORT=7777 - LAUNCHER_URL=ws://rod:7317 - - ASSETS_PATH=/assets + - ASSETS_PATH=/assets/assets - REDIS_URL=redis:6379 - PREVIEW_URL=http://preview:7777 - - PROXY_TO=https://gcsim.app + - PROXY_TO - AUTH_KEY + - ASSETS_PAT_TOKEN ports: - 7777:7777 restart: unless-stopped \ No newline at end of file diff --git a/cmd/preview/init.sh b/cmd/preview/init.sh new file mode 100644 index 0000000..6c21014 --- /dev/null +++ b/cmd/preview/init.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +ls -la + +# Get the value of the environment variable +PAT="$ASSETS_PAT_TOKEN" + +# Clone the repository with the substituted value +git clone "https://$PAT@github.com/genshinsim/assets.git" + +./preview \ No newline at end of file