Shipmaster1 commited on
Commit
4b2467b
·
verified ·
1 Parent(s): 655994d

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +42 -0
Dockerfile ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Get a distribution that has uv already installed
2
+ FROM ghcr.io/astral-sh/uv:python3.13-bookworm-slim
3
+
4
+ # Add Rust compiler installation
5
+ USER root
6
+ RUN apt-get update && apt-get install -y \
7
+ curl \
8
+ build-essential \
9
+ && rm -rf /var/lib/apt/lists/*
10
+ RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
11
+ ENV PATH="/root/.cargo/bin:${PATH}"
12
+
13
+ # Add user - this is the user that will run the app
14
+ # If you do not set user, the app will run as root (undesirable)
15
+ RUN useradd -m -u 1000 user
16
+ USER user
17
+
18
+ # Set up Rust for the user
19
+ RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
20
+ ENV PATH="/home/user/.cargo/bin:${PATH}"
21
+
22
+ # Set the home directory and path
23
+ ENV HOME=/home/user \
24
+ PATH=/home/user/.local/bin:$PATH
25
+
26
+ ENV UVICORN_WS_PROTOCOL=websockets
27
+
28
+ # Set the working directory
29
+ WORKDIR $HOME/app
30
+
31
+ # Copy the app to the container
32
+ COPY --chown=user . $HOME/app
33
+
34
+ # Install the dependencies
35
+ # RUN uv sync --frozen
36
+ RUN uv sync
37
+
38
+ # Expose the port
39
+ EXPOSE 7860
40
+
41
+ # Run the app
42
+ CMD ["uv", "run", "chainlit", "run", "app.py", "--host", "0.0.0.0", "--port", "7860"]