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

FIX: Dockerfile environment for production #1089

Merged
merged 3 commits into from
Sep 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ services:
- "API_URL=http://localhost/swagger/"

neuroscout:
command: cd /neuroscout && /usr/local/bin/gunicorn -w 2 -b :8000 neuroscout.core:app --log-level debug --timeout 120 --reload
command: /usr/local/bin/gunicorn --chdir /neuroscout -w 2 -b :8000 neuroscout.core:app --log-level debug --timeout 120 --reload
restart: "no"
build: ./neuroscout
ports:
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.prod.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
version: "2"
services:
neuroscout:
image: ghcr.io/neuroscout/neuroscout:master
image: ghcr.io/neuroscout/neuroscout:latest
command: /usr/local/bin/gunicorn -w 2 -b :8000 neuroscout.core:app --log-level debug --timeout 120 --log-file /logs/gunicorn.log
16 changes: 8 additions & 8 deletions neuroscout/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM python:3.8-bullseye
ARG DEBIAN_FRONTEND=noninteractive

RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
RUN mkdir -p /usr/src/app/neuroscout
WORKDIR /usr/src/app/neuroscout

RUN apt-get -qq update
RUN apt-get install -yq ffmpeg tesseract-ocr apt-transport-https libnss3 xvfb
Expand All @@ -21,26 +21,26 @@ RUN apt-get update
RUN apt-get install -y nodejs
RUN npm install -g yarn

COPY requirements.txt /usr/src/app/
COPY optional_requirements.txt /usr/src/app
COPY requirements.txt /usr/src/app/neuroscout/
COPY optional_requirements.txt /usr/src/app/neuroscout/
RUN pip install setuptools==45
RUN pip uninstall -y enum34
RUN pip install --no-cache-dir -r requirements.txt
RUN pip install --no-cache-dir -r optional_requirements.txt
RUN python -m pliers.support.download
RUN python -m pliers.support.setup_yamnet

COPY . /usr/src/app
COPY . /usr/src/app/neuroscout

RUN git config --global user.name "Neuroscout"
RUN git config --global user.email "delavega@utexas.edu"

RUN crontab /usr/src/app/update.txt
RUN crontab /usr/src/app/neuroscout/update.txt
RUN service cron start

WORKDIR /usr/src/app/frontend
WORKDIR /usr/src/app/neuroscout/frontend

RUN cp /usr/src/app/frontend/src/config.ts.prod /usr/src/app/frontend/src/config.ts
RUN cp /usr/src/app/neuroscout/frontend/src/config.ts.prod /usr/src/app/neuroscout/frontend/src/config.ts
RUN yarn install && yarn build

WORKDIR /usr/src/app/