-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (23 loc) · 780 Bytes
/
Dockerfile
File metadata and controls
33 lines (23 loc) · 780 Bytes
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
FROM python:3.11-slim
ARG APP_VERSION=dev
ENV APP_VERSION=${APP_VERSION}
WORKDIR /app
# Create non-root user
RUN apt-get update \
&& apt-get install -y --no-install-recommends cron \
&& rm -rf /var/lib/apt/lists/* \
&& adduser --disabled-password --gecos "" appuser
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY raid.py availableraids.py smoke_test.py ./
RUN python smoke_test.py && rm smoke_test.py
COPY cron ./cron/
# Install cron job for the app user
RUN crontab -u appuser /app/cron/availableraids
# Ensure app files are readable by appuser
RUN chown -R appuser:appuser /app
# Entrypoint starts cron, then the web server
COPY entrypoint.sh .
RUN chmod +x /app/entrypoint.sh
EXPOSE 8000
ENTRYPOINT ["/app/entrypoint.sh"]