Skip to content

Commit

Permalink
support setting timezone in docker images (#2091)
Browse files Browse the repository at this point in the history
  • Loading branch information
bowenliang123 authored Jan 19, 2024
1 parent ec1659c commit 9ad7b65
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ RUN pip install --prefix=/pkg -r requirements.txt
# build stage
FROM python:3.10-slim AS builder


ENV FLASK_APP app.py
ENV EDITION SELF_HOSTED
ENV DEPLOY_ENV PRODUCTION
Expand All @@ -23,6 +24,11 @@ ENV APP_WEB_URL http://127.0.0.1:3000

EXPOSE 5001

# set timezone
ENV TZ UTC
RUN ln -s /usr/share/zoneinfo/${TZ} /etc/localtime \
&& echo ${TZ} > /etc/timezone

WORKDIR /app/api

RUN apt-get update \
Expand Down
7 changes: 7 additions & 0 deletions web/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
FROM node:20.11.0-alpine AS base
LABEL maintainer="[email protected]"

RUN apk add --no-cache tzdata


# install packages
FROM base as packages

Expand Down Expand Up @@ -32,6 +35,10 @@ ENV CONSOLE_API_URL http://127.0.0.1:5001
ENV APP_API_URL http://127.0.0.1:5001
ENV PORT 3000

# set timezone
ENV TZ UTC
RUN ln -s /usr/share/zoneinfo/${TZ} /etc/localtime \
&& echo ${TZ} > /etc/timezone

WORKDIR /app/web
COPY --from=builder /app/web/public ./public
Expand Down

0 comments on commit 9ad7b65

Please sign in to comment.