ITSAIDI commited on
Commit
7cbea50
·
1 Parent(s): 5c6332d
Files changed (1) hide show
  1. Dockerfile +7 -5
Dockerfile CHANGED
@@ -1,8 +1,8 @@
 
 
1
  FROM python:3.10-slim
2
 
3
- # For Dev mode in Spaces, we need to create a new user with id 1000.
4
- # useradd is a Linux command
5
- RUN useradd -m -u 1000 user
6
 
7
  WORKDIR /firstMcpServer
8
 
@@ -10,11 +10,13 @@ WORKDIR /firstMcpServer
10
 
11
  RUN pip install uv
12
 
13
- # Here we copy the uv configuration file and we set ownership to 'user' with 'chown' Linux command
14
- COPY --chown=user ["pyproject.toml","server.py","./"]
15
 
16
  RUN uv sync
17
 
 
 
 
18
  EXPOSE 8080
19
 
20
  CMD ["uv","run","server.py"]
 
1
+ # Starting from a base image
2
+
3
  FROM python:3.10-slim
4
 
5
+ # We can Not use WORKDIR, but it's recommanded to isolate the application code in the container filesystem. (more clean)
 
 
6
 
7
  WORKDIR /firstMcpServer
8
 
 
10
 
11
  RUN pip install uv
12
 
13
+ COPY ["pyproject.toml","server.py","./"]
 
14
 
15
  RUN uv sync
16
 
17
+ # Just a hint telling docker and readers that the container listens on a that port.
18
+ # It will not publish the port (you can send requests on that port), to perform that you need to add a publish flag when starting a container
19
+
20
  EXPOSE 8080
21
 
22
  CMD ["uv","run","server.py"]