-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
52 lines (34 loc) · 1.01 KB
/
Dockerfile
File metadata and controls
52 lines (34 loc) · 1.01 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# syntax=docker/dockerfile:1.6
FROM python:3.11-slim-buster
ENV TZ=UTC
RUN apt-get update \
&& apt-get install --no-install-recommends -y \
curl \
git \
iputils-ping \
tzdata \
&& rm -rf /var/lib/apt/lists/*
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
ENV DATABASE_NAME=${POSTGRES_DB:-postgres}
ENV DATABASE_URL=${POSTGRES_HOST:-db}
ENV DATABASE_USER=${POSTGRES_USER:-postgres}
ENV DATABASE_PASSWORD=${POSTGRES_PASSWORD}
ENV DATABASE_PORT=${POSTGRES_PORT:-5432}
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONFAULTHANDLER 1
ENV PYTHONUNBUFFERED 1
ENV PIP_DISABLE_PIP_VERSION_CHECK=on
ENV PIP_DEFAULT_TIMEOUT=100
WORKDIR /app
COPY requirements.txt .
RUN python -m pip install --no-cache-dir -r requirements.txt
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
ENV WEB_CONCURRENCY=2
ARG USER_NAME=nonroot
RUN addgroup --system $USER_NAME \
&& adduser --system --ingroup $USER_NAME $USER_NAME
COPY . .
USER $USER_NAME
EXPOSE ${PORT:-8000}
ENTRYPOINT [ "/app/startup.sh" ]