-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
31 lines (23 loc) · 942 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
FROM python:3.10-alpine
# Get latest root certificates
RUN apk add --no-cache ca-certificates tzdata && update-ca-certificates
# Install build dependencies for cffi
RUN apk add --no-cache gcc musl-dev libffi-dev
# Install the required packages
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# PYTHONUNBUFFERED: Force stdin, stdout and stderr to be totally unbuffered. (equivalent to `python -u`)
# PYTHONHASHSEED: Enable hash randomization (equivalent to `python -R`)
# PYTHONDONTWRITEBYTECODE: Do not write byte files to disk, since we maintain it as readonly. (equivalent to `python -B`)
ENV PYTHONUNBUFFERED=1 PYTHONHASHSEED=random PYTHONDONTWRITEBYTECODE=1
# Default port for Flower
EXPOSE 5555
ENV APP_DIR /app
ENV PYTHONPATH ${APP_DIR}
WORKDIR $APP_DIR
COPY . .
COPY .env .
RUN addgroup -g 1000 flower \
&& adduser -u 1000 -G flower -D flower \
&& chown -R flower:flower $APP_DIR
USER flower