allow setting of timezone via environment variable

This commit is contained in:
mcinj 2022-04-24 12:10:37 -04:00
parent 1e5dd1b717
commit c144fb6d96
2 changed files with 7 additions and 4 deletions

View file

@ -4,12 +4,13 @@ RUN mkdir -p /app
WORKDIR /app WORKDIR /app
# resolves gcc issue with installing regex dependency # resolves gcc issue with installing regex dependency
RUN apk add build-base --no-cache RUN apk add build-base tzdata --no-cache
ENV TZ=Africa/New_York
ENV VIRTUAL_ENV=/app/env ENV VIRTUAL_ENV=/app/env
RUN python -m venv $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/bin:$PATH" ENV PATH="$VIRTUAL_ENV/bin:$PATH"
RUN python -m venv $VIRTUAL_ENV
COPY requirements.txt . COPY requirements.txt .
RUN pip3 install -r requirements.txt RUN pip3 install -r requirements.txt

View file

@ -28,7 +28,8 @@ python run.py
#### Run it #### Run it
```bash ```bash
# Run the container # Run the container
docker run --name steamgifts -d -v /path/to/the/config/folder:/config mcinj/docker-steamgifts-bot:v2.0 # Set TZ based on your timezone: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
docker run --name steamgifts -e TZ=America/New_York -d -v /path/to/the/config/folder:/config mcinj/docker-steamgifts-bot:v2.0
``` ```
#### Or build it yourself locally #### Or build it yourself locally
@ -36,7 +37,8 @@ docker run --name steamgifts -d -v /path/to/the/config/folder:/config mcinj/dock
# Build the image # Build the image
docker build -t steamgifts:latest . docker build -t steamgifts:latest .
# Run the container # Run the container
docker run --name steamgifts -d -v /path/to/the/config/folder:/config steamgifts:latest # Set TZ based on your timezone: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
docker run --name steamgifts -e TZ=America/New_York -d -v /path/to/the/config/folder:/config steamgifts:latest
``` ```