Skip to content

Commit

Permalink
docker_file_updated_to_run_virtualenv (#436)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lungsangg authored Nov 20, 2024
2 parents 6f5589f + 36b7981 commit 91e2965
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
15 changes: 14 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,23 @@ COPY ./static/js ./static/js
RUN npm run setup
RUN npm run build-prod

# Create a virtual environment with Python 3.12
ENV VIRTUAL_ENV="/env"
RUN python3.12 -m venv $VIRTUAL_ENV

# Install Pillow 11 in the virtual environment
RUN $VIRTUAL_ENV/bin/pip install --upgrade pip && \
$VIRTUAL_ENV/bin/pip install Pillow==11.0.0

# Copy application source code
COPY . ./

# Ensure the virtual environment is used for the application
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
RUN echo "PATH is set to: $PATH"

# Run Django migrations and start the server
CMD ["bash", "-c", "python manage.py migrate && python manage.py runserver 0.0.0.0:8000"]

# Expose the port that the Django server will listen on
EXPOSE 8000
EXPOSE 8000
2 changes: 1 addition & 1 deletion sefaria/local_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
################ These are things you DO NOT NEED to touch unless you know what you are doing. ##############################
# DEBUG = os.getenv("DEBUG", "True") == "True"
# In Render environment variables:
DEBUG = False
DEBUG = True

REMOTE_HOSTS = os.getenv('REMOTE_HOSTS', 'staging.pecha.org').replace(" ", "")

Expand Down

0 comments on commit 91e2965

Please sign in to comment.