Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed Docker issue #148

Open
wants to merge 1 commit into
base: stable
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
# Use an official Python runtime as the parent image
FROM python:3.11-bullseye
RUN apt-get update && apt-get install -y \

# Update APT and install required system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
ffmpeg \
imagemagick \
ghostscript \
fonts-roboto \
&& apt-get clean && rm -rf /var/lib/apt/lists/*

# Update font cache
RUN fc-cache -f -v

# Modify ImageMagick policy file to remove restrictions
RUN sed -i '/<policy domain="path" rights="none" pattern="@\*"/d' /etc/ImageMagick-6/policy.xml
# Clean up APT when done
RUN apt-get clean && rm -rf /var/lib/apt/lists/*

# Set the working directory in the container to /app
# Set the working directory in the container
WORKDIR /app

# Install any Python packages specified in requirements.txt
# Copy requirements file
# Copy requirements file into the container
COPY requirements.txt .

# Install dependencies
RUN pip install -r requirements.txt
# Upgrade pip and install necessary packages first
RUN pip install --no-cache-dir --upgrade pip \
&& pip install --no-cache-dir Cython numpy

# Copy the local package directory content into the container at /app
COPY . /app
# Install other Python dependencies with legacy resolver
RUN pip install --no-cache-dir -r requirements.txt --use-deprecated=legacy-resolver

EXPOSE 31415
# Copy the entire application code into the container
COPY . .

# Define any environment variables
# ENV KEY Value

# Print environment variables (for debugging purposes, you can remove this line if not needed)
RUN ["printenv"]
# Expose the application port
EXPOSE 31415

# Run Python script when the container launches
CMD ["python", "./runShortGPT.py"]
# Command to run the Python script when the container launches
CMD ["python", "runShortGPT.py"]