Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support setting timezone in docker images #2091

Merged
merged 6 commits into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
@@ -1,6 +1,9 @@
# base image
FROM node:20.11.0-alpine AS base

RUN apk add --no-cache tzdata


# install packages
FROM base as packages
LABEL maintainer="[email protected]"
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