Browse Source

support setting timezone in docker images (#2091)

tags/0.4.9
Bowen Liang 1 year ago
parent
commit
9ad7b65996
No account linked to committer's email address
2 changed files with 13 additions and 0 deletions
  1. 6
    0
      api/Dockerfile
  2. 7
    0
      web/Dockerfile

+ 6
- 0
api/Dockerfile View File

# build stage # build stage
FROM python:3.10-slim AS builder FROM python:3.10-slim AS builder



ENV FLASK_APP app.py ENV FLASK_APP app.py
ENV EDITION SELF_HOSTED ENV EDITION SELF_HOSTED
ENV DEPLOY_ENV PRODUCTION ENV DEPLOY_ENV PRODUCTION


EXPOSE 5001 EXPOSE 5001


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

WORKDIR /app/api WORKDIR /app/api


RUN apt-get update \ RUN apt-get update \

+ 7
- 0
web/Dockerfile View File

FROM node:20.11.0-alpine AS base FROM node:20.11.0-alpine AS base
LABEL maintainer="takatost@gmail.com" LABEL maintainer="takatost@gmail.com"


RUN apk add --no-cache tzdata


# install packages # install packages
FROM base as packages FROM base as packages


ENV APP_API_URL http://127.0.0.1:5001 ENV APP_API_URL http://127.0.0.1:5001
ENV PORT 3000 ENV PORT 3000


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


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

Loading…
Cancel
Save