-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
40 lines (35 loc) · 1.02 KB
/
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
32
33
34
35
36
37
38
39
40
FROM python:3.11-slim AS base
# Setup env
ENV LANG=C.UTF-8
ENV LC_ALL=C.UTF-8
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONFAULTHANDLER=1
ENV PYTHONHASHSEED=random
ENV PYTHONUNBUFFERED=1
#FROM base AS python-deps
WORKDIR /app
# Set timezone
ENV TZ=America/New_York
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# Install python dependencies
RUN apt-get update && apt-get install -y --no-install-recommends tree libpq-dev #gcc git
# Setup Poetry
RUN pip install poetry
# Skip venvs for Docker
RUN poetry config virtualenvs.create false
# Install application into container
# Don't forget to check the .dockerignore
COPY pyproject.toml .
COPY poetry.lock .
# Install ALL packages
RUN poetry install --no-interaction --no-root --without test
COPY . .
RUN tree /app
#RUN pip install -e .
# Create and switch to a new user
# TODO Switch to non-root at some point
#RUN useradd --create-home appuser
#RUN chown appuser:appuser -R /app/
#RUN chmod a+rwx -R -R /app/
#USER appuser
ENV PYTHONPATH "${PYTHONPATH}:/fedi_gatus"