Sefaria / Sefaria-Project

New Interfaces for Jewish Texts
https://www.sefaria.org
654 stars 268 forks source link

ci: Dockerfile problems #1997

Closed ShlomoV5 closed 1 month ago

ShlomoV5 commented 1 month ago

I used docker compose to setup locally. Dockerfile uses python 3.7 which causes errors during the setup. Python 3.9 works for me Also, git is missing from the container

Needs to be:

# Use an official Python runtime as a parent image
FROM python:3.9-slim

# Set the working directory to /app
WORKDIR /app

# Copy the current directory contents into the container at /app
COPY . /app

# Install psycopg2 dependencies
RUN apt-get update && apt-get install -y libpq-dev

# Install git
RUN apt-get update && apt-get install -y git

# Install gcc
RUN apt-get update && apt-get install -y gcc

# Install any needed packages specified in requirements.txt
RUN pip install --trusted-host pypi.python.org -r requirements.txt

# Make port 8000 available to the world outside this container
EXPOSE 8000

# Define environment variable
ENV NAME Sefaria-Project

# Run app.py when the container launches
CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]
saengel commented 1 month ago

Thank you for pointing this out! In our guide to the local installation here we provide a caveat that the docker approach has not yet been fully tested and is still an experiment. One thing to note, is that in general we find that the majority of our users can get everything they need just via the API, and they don't require a local installation.

As we continue to think about docker, we'll keep your notes in mind. Thanks again!