Skip to content

Commit

Permalink
Better dockeriziation
Browse files Browse the repository at this point in the history
  • Loading branch information
ssilverm committed Mar 29, 2022
1 parent 0851770 commit d916489
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 67 deletions.
13 changes: 5 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
FROM tiangolo/uwsgi-nginx-flask:python3.7
FROM python:3.7 as base
ARG REQUIREMENTS
RUN apt-get update && apt-get -y install libffi-dev gcc python3-dev libffi-dev libssl-dev libxml2-dev libxmlsec1-dev libxmlsec1-openssl
RUN apt-get -y install ca-certificates
WORKDIR /app
COPY requirements.txt /app/
COPY test_requirements.txt /app/
COPY devops/nginx.conf /app
COPY devops/uwsgi.ini /app
RUN echo $REQUIREMENTS
RUN pip install -r $REQUIREMENTS
RUN pip install -r /app/$REQUIREMENTS
WORKDIR /app
COPY ./ /app/
EXPOSE 9001
CMD ["gunicorn", "--conf", "gunicorn_conf.py", "--bind", "0.0.0.0:9001", "lti:app"]
44 changes: 0 additions & 44 deletions devops/nginx.conf

This file was deleted.

4 changes: 0 additions & 4 deletions devops/uwsgi.ini

This file was deleted.

5 changes: 2 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,15 @@ services:
args:
- "REQUIREMENTS=${REQUIREMENTS}"
ports:
- "9001:80"
- "9001:9001"
env_file:
- .env
environment:
- MODULE_NAME=app
depends_on:
- db

db:
image: mysql:5.7
platform: linux/amd64
volumes:
- ft_dbdata:/var/lib/mysql
restart: always
Expand Down
9 changes: 9 additions & 0 deletions gunicorn_conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Gunicorn config variables
loglevel = "info"
errorlog = "-" # stderr
accesslog = "-" # stdout
worker_tmp_dir = "/dev/shm"
graceful_timeout = 120
timeout = 120
keepalive = 5
threads = 3
14 changes: 7 additions & 7 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
canvasapi==0.15.0
Flask==1.1.1
Flask-SQLAlchemy==2.5.1
mysqlclient
git+https://github.com/ucfcdl/pylti.git@roles#egg=PyLTI
requests==2.22.0
Werkzeug>=1.0.1 # Chrome 80 SameSite fix
Flask==2.0.3
-e git+https://github.com/ucfcdl/pylti.git@roles#egg=PyLTI
requests==2.23.0
gunicorn==20.1.0
mysqlclient==2.1.0
Flask-SQLAlchemy
canvasapi==2.2.0
2 changes: 1 addition & 1 deletion settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

# Canvas instance URL. ex: https://example.instructure.com/
BASE_URL = os.environ.get("BASE_CANVAS_SERVER_URL")
API_URL = BASE_URL + "api/v1/"
API_URL = BASE_URL

# Secret key to sign Flask sessions with. KEEP THIS SECRET!
secret_key = os.environ.get("SECRET_KEY")
Expand Down

0 comments on commit d916489

Please sign in to comment.