File size: 509 Bytes
486aa0e
ed40e77
486aa0e
 
ed40e77
 
486aa0e
 
68b2f03
ed40e77
 
486aa0e
 
 
 
2e25d6d
486aa0e
 
68b2f03
486aa0e
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Use the official Python image from the Docker Hub
FROM python:3.9

# Create a new user and set permissions
RUN useradd -m -u 1000 user
USER user

# Set environment variables
ENV PATH="/home/user/.local/bin:$PATH"
WORKDIR /code

RUN pip install libretranslate waitress

# Copy the application code
COPY --chown=user . .

# Expose the port the app runs on
EXPOSE 7860

# Run the application using waitress (recommended for production)
CMD ["waitress-serve", "--host", "0.0.0.0", "--port", "7860", "app:main"]