Skip to content

Commit 3daa7bf

Browse files
walkerleesolderzzc
authored andcommitted
Use TZ as timezone environment (#5091)
* Use TZ as timezone environment * Change TIMEZONE to TZ
1 parent c9a6f08 commit 3daa7bf

File tree

4 files changed

+5
-15
lines changed

4 files changed

+5
-15
lines changed

Dockerfile

+2-12
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#
1111
# You can also build from different fork and specify a particular commit as the branch
1212
#
13-
# docker build --build-arg BUILD_REPO=YourFork/PokemonGo-Bot --build-arg BUILD_BRANCH=6a4580f .
13+
# docker build --build-arg BUILD_REPO=YourFork/PokemonGo-Bot --build-arg BUILD_BRANCH=6a4580f .
1414

1515
FROM alpine
1616

@@ -45,14 +45,4 @@ RUN apk -U --no-cache add --virtual .pgobot-dependencies wget ca-certificates ta
4545
&& apk del .pgobot-dependencies \
4646
&& rm -rf /var/cache/apk/* /tmp/pgobot-version
4747

48-
RUN printf "#!/bin/sh\n\
49-
\n\
50-
TIMEZONE=\${TIMEZONE:-Etc/UTC}\n\
51-
\n\
52-
ln -sfn /usr/share/zoneinfo/\$TIMEZONE /etc/localtime\n\
53-
echo \$TIMEZONE > /etc/timezone\n\
54-
\n\
55-
python pokecli.py \$@\n" > /entrypoint.sh \
56-
&& chmod +x /entrypoint.sh
57-
58-
ENTRYPOINT ["/entrypoint.sh"]
48+
ENTRYPOINT ["python", "pokecli.py"]

docker-compose.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ services:
77
- ./data:/usr/src/app/data
88
- ./web:/usr/src/app/web
99
environment:
10-
- TIMEZONE=Etc/UTC
10+
- TZ=Etc/UTC
1111
stdin_open: true
1212
tty: true
1313
bot1-pokegoweb:

docker-compose_tor.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ services:
2424
- ./data:/usr/src/app/data
2525
- ./web:/usr/src/app/web
2626
environment:
27-
- TIMEZONE=Etc/UTC
27+
- TZ=Etc/UTC
2828
stdin_open: true
2929
tty: true
3030
bot1-pokegoweb:

docs/installation.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ docker run --name=bot1-pokego --rm -it -v $(pwd)/configs/config.json:/usr/src/ap
8484
Optionally you can set your timezone with the -e option (default is Etc/UTC). You can find an exhaustive list of timezone here: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
8585

8686
```
87-
docker run --name=bot1-pokego --rm -it -e TIMEZONE=Asia/Taipei -v $(pwd)/configs/config.json:/usr/src/app/configs/config.json pokemongo-bot
87+
docker run --name=bot1-pokego --rm -it -e TZ=Asia/Taipei -v $(pwd)/configs/config.json:/usr/src/app/configs/config.json pokemongo-bot
8888
```
8989

9090
>In the case you configured authentification to be handled by auth.json file make sure you mount that file as a volume also

0 commit comments

Comments
 (0)