-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
43 lines (30 loc) · 982 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
32
33
34
35
36
37
38
39
40
41
42
43
FROM python:3.11
LABEL name="alfredo-ai"
LABEL maintainer="Regis Leandro Buske - [email protected]"
WORKDIR /app
RUN apt-get update && apt-get install -y \
build-essential \
curl \
software-properties-common \
git \
&& curl -fsSL https://deb.nodesource.com/setup_21.x | bash - \
&& apt-get install -y nodejs \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN git clone https://github.com/regisleandro/alfredo_ai.git .
RUN pip3 install -r requirements.txt
# Set up Node.js environment
WORKDIR /app/alfredo_rocket/
RUN npm install
WORKDIR /app
RUN chmod +x /app/start_services.sh
# Create a non-root user and change ownership of the /app directory
RUN useradd -u 1002 -ms /bin/bash user
RUN chown user:user -R /app
# Switch to the non-root user
USER user
# Expose the port
EXPOSE 8501
# Healthcheck to ensure the service is running
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health || exit 1
ENTRYPOINT ["/app/start_services.sh"]