-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFrontend.Dockerfile
More file actions
55 lines (43 loc) · 1.48 KB
/
Frontend.Dockerfile
File metadata and controls
55 lines (43 loc) · 1.48 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
53
54
# syntax=docker/dockerfile:1
# Base Image
FROM python:3.11-slim-bullseye as base
ENV PYTHONUNBUFFERED 1
# Metadata
LABEL author=max-scw
LABEL project=https://github.com/max-scw/BaslerCameraAdapter
LABEL version=2024.10.21
# Environment variables (default values)
ARG DEBIAN_FRONTEND=noninteractived
RUN printf "deb https://deb.debian.org/debian bullseye main \
deb https://security.debian.org/debian-security bullseye-security main \
deb https://deb.debian.org/debian bullseye-updates main" > /etc/apt/sources.list
RUN mkdir /data
# new default user
RUN useradd -ms /bin/bash appuser
# Set the working directory
WORKDIR /home/app
# Install requirements
COPY requirements_frontend.txt ./requirements.txt
RUN pip install -r requirements.txt --no-cache-dir
# Copy app into the container
# 1. copy shated files
COPY utils.py \
DataModels.py \
README.md \
LICENSE \
./
# 2. copy individual files
COPY app.py ./
# Expose the ports
EXPOSE 8501
# Define the health check using curl for both HTTP and HTTPS
HEALTHCHECK --interval=30s --timeout=5s \
CMD (curl -fsk http://localhost:8501/_stcore/health) || (curl -fsk https://localhost:8501/_stcore/health) || exit 1
# set to non-root user
USER root
RUN chown -R appuser:appuser /home/app
RUN chown -R appuser:appuser /data
USER appuser
# Set the entrypoint script as the entrypoint for the container
CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]
#CMD ["tail", "-f", "/dev/null"]