Skip to content

Commit

Permalink
Merge pull request #303 from hackforla/295_BACK_CORS
Browse files Browse the repository at this point in the history
CORS, docker, requirements fixes
  • Loading branch information
sellnat77 authored Feb 27, 2020
2 parents 2a656db + 85a90cb commit 40da08a
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 34 deletions.
10 changes: 0 additions & 10 deletions onboard.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,6 @@ else
echo "WARN If errors persist, follow this to remove lfs \n\n\thttps://github.com/git-lfs/git-lfs/issues/3026#issuecomment-451598434"
fi

# Check for postgres tools
if ! [ -x "$(command -v pg_config)" ]; then
echo "👺Error: pg_config is not installed." >&2
echo "👺👺👺 The backend required psycopg2 which requires a manual install of pg_config and libpq headers."
echo "👺👺👺 To install those, please refer to \n\n\thttp://initd.org/psycopg/docs/install.html"
exit 1
fi
echo "👍 Found pg_config installation"


# Check for python3
if ! [ -x "$(command -v python3)" ]; then
echo "👺Error: python3 is not installed." >&2
Expand Down
16 changes: 6 additions & 10 deletions server/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
FROM python:3.7-alpine
FROM python:3.7-slim

RUN echo "http://dl-8.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories
RUN apt-get update && apt-get install -yq \
python3 python3-dev gcc \
gfortran musl-dev

RUN apk add --no-cache --allow-untrusted --repository http://dl-3.alpinelinux.org/alpine/edge/testing hdf5 hdf5-dev
RUN apk --no-cache --update-cache add gcc musl-dev gfortran python python-dev py-pip build-base wget freetype-dev libpng-dev postgresql-dev openblas-dev \
&& pip install --no-cache-dir cython numpy
RUN ln -s /usr/include/locale.h /usr/include/xlocale.h
COPY requirements.txt .


COPY requirements.txt /

RUN pip install --no-cache-dir -r /requirements.txt
RUN pip install --no-cache-dir -r requirements.txt

COPY src/ /app

Expand Down
25 changes: 11 additions & 14 deletions server/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
aiofiles==0.4.0
attrs==19.3.0
certifi==2019.9.11
certifi==2019.11.28
chardet==3.0.4
Click==7.0
entrypoints==0.3
flake8==3.7.9
h11==0.8.1
Expand All @@ -11,37 +10,35 @@ hpack==3.0.0
httpcore==0.3.0
httptools==0.0.13
hyperframe==5.2.0
idna==2.8
idna==2.9
importlib-metadata==1.4.0
itsdangerous==1.1.0
Jinja2==2.10.3
MarkupSafe==1.1.1
mccabe==0.6.1
more-itertools==8.1.0
multidict==4.5.2
numpy==1.18.0
numpy==1.18.1
packaging==20.0
pandas==0.25.3
pandas==1.0.1
pluggy==0.13.1
psycopg2==2.8.4
psycopg2-binary==2.8.4
py==1.8.1
pycodestyle==2.5.0
pyflakes==2.1.1
pyparsing==2.4.6
pytest==5.3.3
python-dateutil==2.8.1
pytz==2019.3
requests==2.22.0
requests==2.23.0
requests-async==0.5.0
rfc3986==1.3.2
sanic==19.9.0
six==1.13.0
Sanic-Cors==0.10.0.post3
Sanic-Plugins-Framework==0.9.2
six==1.14.0
sodapy==2.0.0
SQLAlchemy==1.3.11
SQLAlchemy==1.3.13
ujson==1.35
urllib3==1.25.7
urllib3==1.25.8
uvloop==0.14.0
wcwidth==0.1.8
websockets==8.1
Werkzeug==0.16.0
zipp==1.0.0
2 changes: 2 additions & 0 deletions server/src/app.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os
from sanic import Sanic
from sanic.response import json
from sanic_cors import CORS
from configparser import ConfigParser
from threading import Timer
from datetime import datetime
Expand All @@ -13,6 +14,7 @@
from services.sqlIngest import DataHandler

app = Sanic(__name__)
CORS(app)


def configure_app():
Expand Down

0 comments on commit 40da08a

Please sign in to comment.