forked from Sefaria/Sefaria-Project
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
2,206 additions
and
2,430 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -133,3 +133,10 @@ static/sheetrank.json | |
|
||
env/* | ||
dump/* | ||
tmp/* | ||
log/* | ||
/static/bundles | ||
/dockerData | ||
|
||
.env | ||
.envrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,29 @@ | ||
# Use an official Python runtime as a parent image | ||
FROM python:3.7-slim | ||
# Use node-python image as the base image | ||
FROM beevk/node-python:0.2 | ||
|
||
# Set the working directory to /app | ||
# Set the working directory inside the container | ||
WORKDIR /app | ||
|
||
# Copy the current directory contents into the container at /app | ||
COPY . /app | ||
# Copy the local_settings.py file to the working directory | ||
COPY ./sefaria/local_settings.py ./sefaria/local_settings.py | ||
|
||
# Install psycopg2 dependencies | ||
RUN apt-get update && apt-get install -y libpq-dev | ||
# Copy the requirements.txt file and install dependencies | ||
COPY requirements.txt ./ | ||
COPY package*.json ./ | ||
|
||
# Install gcc | ||
RUN apt-get update && apt-get install -y gcc | ||
RUN pip install -r requirements.txt | ||
RUN npm install --unsafe-perm | ||
|
||
# Install any needed packages specified in requirements.txt | ||
RUN pip install --trusted-host pypi.python.org -r requirements.txt | ||
COPY ./node ./node | ||
COPY ./static/js ./static/js | ||
|
||
# Make port 8000 available to the world outside this container | ||
EXPOSE 8000 | ||
RUN npm run setup | ||
RUN npm run build-prod | ||
|
||
# Define environment variable | ||
ENV NAME Sefaria-Project | ||
COPY . ./ | ||
|
||
# Run app.py when the container launches | ||
CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"] | ||
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env bash | ||
# exit on error | ||
set -o errexit | ||
|
||
pip install -r requirements.txt | ||
python manage.py collectstatic --no-input | ||
python manage.py migrate | ||
python manage.py createsu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,16 @@ | ||
version: '3' | ||
version: '3.8' | ||
|
||
services: | ||
web: | ||
build: . | ||
sefaria: | ||
image: ghcr.io/sidzan/sidzan/sefaria:latest | ||
container_name: sefaria-local | ||
ports: | ||
- "8000:8000" | ||
volumes: | ||
- .:/app | ||
depends_on: | ||
- db | ||
- cache | ||
- postgres | ||
|
||
db: | ||
image: "mongo:4.4" | ||
ports: | ||
- "27018:27017" | ||
volumes: | ||
- mongo-data:/data/db | ||
|
||
cache: | ||
image: "redis:latest" | ||
ports: | ||
- "6379:6379" | ||
|
||
node: | ||
image: "node:latest" | ||
working_dir: /app | ||
volumes: | ||
- .:/app | ||
command: npm start | ||
ports: | ||
- "3000:3000" | ||
|
||
postgres: | ||
image: "postgres:latest" | ||
environment: | ||
POSTGRES_USER: admin | ||
POSTGRES_PASSWORD: admin | ||
POSTGRES_DB: sefaria | ||
ports: | ||
- "5433:5432" | ||
volumes: | ||
- postgres-data:/var/lib/postgresql/sefaria_data | ||
|
||
volumes: | ||
mongo-data: | ||
postgres-data: | ||
- MONGO_DATABASE_NAME=${MONGO_DATABASE_NAME} | ||
- MONGO_HOST=${MONGO_HOST} | ||
- POSTGRESQL_DATABASE_NAME=${POSTGRESQL_DATABASE_NAME} | ||
- POSTGRESQL_HOST=${POSTGRESQL_HOST} | ||
- POSTGRESQL_PASSWORD=${POSTGRESQL_PASSWORD} | ||
- POSTGRESQL_USER=${POSTGRESQL_USER} | ||
- REDIS_HOST=${REDIS_HOST} |
Oops, something went wrong.