asv7j commited on
Commit
ed40e77
·
verified ·
1 Parent(s): 2e25d6d

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -12
Dockerfile CHANGED
@@ -1,16 +1,15 @@
1
- FROM libretranslate/libretranslate
2
-
3
- # You may not need to add a new user if the base image already provides one
4
- # RUN useradd -m -u 1000 user
5
-
6
- # Specify the user to use (if necessary)
7
- # USER user
8
-
9
- # Set the environment variable for PATH, if needed
10
  ENV PATH="/home/user/.local/bin:$PATH"
 
 
 
11
 
12
- # Expose the default LibreTranslate port (5000)
 
 
13
  EXPOSE 5000
14
 
15
- # Example CMD to load specific languages during startup
16
- CMD ["--load-only", "hi,en"]
 
1
+ FROM python:3.9
2
+ RUN useradd -m -u 1000 user
3
+ USER user
 
 
 
 
 
 
4
  ENV PATH="/home/user/.local/bin:$PATH"
5
+ WORKDIR /code
6
+
7
+ RUN pip install fastapi requests libretranslate uvicorn[standard]==0.17.*
8
 
9
+ COPY . .
10
+ COPY --chown=user . /app
11
+ # Expose the port FastAPI will use
12
  EXPOSE 5000
13
 
14
+ # Command to run the FastAPI app with uvicorn
15
+ CMD ["uvicorn", "main:app", "--host", "127.0.0.1", "--port", "5000"]