diff --git a/.travis.yml b/.travis.yml index b7133218..a6d15946 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,5 +15,5 @@ before_install: - sleep 90 script: -- docker-compose -f docker-compose-test.yml -p test run --rm --entrypoint 'bash tests.sh' api +- docker-compose -f docker-compose-test.yml -p test run --rm --entrypoint 'sh tests.sh' api - docker-compose -f docker-compose-test.yml -p test run --rm --entrypoint 'npm test' node diff --git a/api/Dockerfile b/api/Dockerfile index a01e453e..ca29bdd6 100644 --- a/api/Dockerfile +++ b/api/Dockerfile @@ -1,7 +1,10 @@ -FROM python:2.7 +FROM python:2.7.13-alpine3.4 ENV PYTHONUNBUFFERED 1 RUN mkdir /code WORKDIR /code ADD base/requirements.txt /code/requirements.txt +# TODO: We need to find a way to only include the db bindings the API needs to run. +# Right now the entire mariadb package will be included. +RUN apk add --update g++ git mariadb-dev RUN pip install -r requirements.txt ADD . /code/ \ No newline at end of file diff --git a/api/base/gunicorn_start.sh b/api/base/gunicorn_start.sh index 871b2924..0a3fe950 100755 --- a/api/base/gunicorn_start.sh +++ b/api/base/gunicorn_start.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env sh NAME="OpenEats" # Name of the application DJANGODIR=/code # Django project directory @@ -21,4 +21,4 @@ exec gunicorn ${DJANGO_WSGI_MODULE}:application \ --name $NAME \ --workers $NUM_WORKERS \ --user=$USER --group=$GROUP \ - --bind=$API_URL \ No newline at end of file + --bind=$API_URL diff --git a/api/tests.sh b/api/tests.sh index 81a73e57..825670c1 100755 --- a/api/tests.sh +++ b/api/tests.sh @@ -1,5 +1,5 @@ -#!/bin/bash +#!/usr/bin/env sh python manage.py reset_db --noinput python manage.py migrate -python manage.py test -k \ No newline at end of file +python manage.py test -k diff --git a/docker-compose-test.yml b/docker-compose-test.yml index 09763f2b..e39cc7a1 100644 --- a/docker-compose-test.yml +++ b/docker-compose-test.yml @@ -1,7 +1,7 @@ version: '2' services: api: - command: bash tests.sh + command: sh tests.sh build: api/ volumes: - static-files:/code/static-files diff --git a/docs/React_i18n.md b/docs/React_i18n.md index f51ef1b7..774ebaf4 100644 --- a/docs/React_i18n.md +++ b/docs/React_i18n.md @@ -3,6 +3,6 @@ After adding new `defineMessages` you'll need to update the locale files. Instead of doing it manually you can run this script to do it for you. ```bash -docker-compose run --rm node bash +docker-compose run --rm node sh ./node_modules/.bin/babel-node scripts/merge-locale.js ``` \ No newline at end of file diff --git a/docs/Running_the_App.md b/docs/Running_the_App.md index 07ab0c00..b8ad01df 100644 --- a/docs/Running_the_App.md +++ b/docs/Running_the_App.md @@ -42,7 +42,7 @@ docker-compose up -d Regardless of if your running the app in production or development, you need to seed the database. -Run `docker-compose run --rm api bash` to open a bash shell to the API. +Run `docker-compose run --rm api sh` to open a bash shell to the API. ```bash ./manage.py migrate ./manage.py collectstatic diff --git a/frontend/Dockerfile b/frontend/Dockerfile index c8a23171..7827ddc9 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -1,4 +1,4 @@ -FROM node:argon +FROM node:8.3.0-alpine # Create app directory RUN mkdir /code @@ -7,7 +7,5 @@ WORKDIR /code # Install app dependencies ADD . /code/ -# Install Yarn -# See: https://yarnpkg.com/en/docs/install#alternatives-tab -RUN curl -o- -L https://yarnpkg.com/install.sh | bash -RUN $HOME/.yarn/bin/yarn install --pure-lockfile \ No newline at end of file +# Run Yarn to install all dependencies +RUN yarn install --pure-lockfile diff --git a/frontend/package.json b/frontend/package.json index 6727015e..fdb5d2e3 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -58,7 +58,7 @@ "css-loader": "^0.25.0", "http-server": "^0.8.5", "jest": "^19.0.2", - "node-sass": "^3.10.1", + "node-sass": "^4.5.3", "react-test-renderer": "^15.4.2", "sass-loader": "^4.0.2", "style-loader": "^0.13.1", diff --git a/frontend/yarn.lock b/frontend/yarn.lock index e531fa4a..0c06b0f9 100644 --- a/frontend/yarn.lock +++ b/frontend/yarn.lock @@ -2688,6 +2688,10 @@ lodash.memoize@^4.1.0: version "4.1.2" resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe" +lodash.mergewith@^4.6.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/lodash.mergewith/-/lodash.mergewith-4.6.0.tgz#150cf0a16791f5903b8891eab154609274bdea55" + lodash.uniq@^4.3.0: version "4.5.0" resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" @@ -2953,9 +2957,9 @@ node-pre-gyp@^0.6.29: tar "~2.2.1" tar-pack "~3.3.0" -node-sass@^3.10.1: - version "3.13.1" - resolved "https://registry.yarnpkg.com/node-sass/-/node-sass-3.13.1.tgz#7240fbbff2396304b4223527ed3020589c004fc2" +node-sass@^4.5.3: + version "4.5.3" + resolved "https://registry.yarnpkg.com/node-sass/-/node-sass-4.5.3.tgz#d09c9d1179641239d1b97ffc6231fdcec53e1568" dependencies: async-foreach "^0.1.3" chalk "^1.1.1" @@ -2966,13 +2970,15 @@ node-sass@^3.10.1: in-publish "^2.0.0" lodash.assign "^4.2.0" lodash.clonedeep "^4.3.2" + lodash.mergewith "^4.6.0" meow "^3.7.0" mkdirp "^0.5.1" nan "^2.3.2" node-gyp "^3.3.1" npmlog "^4.0.0" - request "^2.61.0" + request "^2.79.0" sass-graph "^2.1.1" + stdout-stream "^1.4.0" "nopt@2 || 3", nopt@~3.0.6: version "3.0.6" @@ -3863,7 +3869,7 @@ repeating@^2.0.0: dependencies: is-finite "^1.0.0" -request@2, request@^2.61.0, request@^2.79.0: +request@2, request@^2.79.0: version "2.80.0" resolved "https://registry.yarnpkg.com/request/-/request-2.80.0.tgz#8cc162d76d79381cdefdd3505d76b80b60589bd0" dependencies: @@ -4152,6 +4158,12 @@ sshpk@^1.7.0: version "1.3.1" resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.3.1.tgz#faf51b9eb74aaef3b3acf4ad5f61abf24cb7b93e" +stdout-stream@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/stdout-stream/-/stdout-stream-1.4.0.tgz#a2c7c8587e54d9427ea9edb3ac3f2cd522df378b" + dependencies: + readable-stream "^2.0.1" + stream-browserify@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/stream-browserify/-/stream-browserify-2.0.1.tgz#66266ee5f9bdb9940a4e4514cafb43bb71e5c9db" diff --git a/services/Dockerfile b/services/Dockerfile index 45e5de73..2e136642 100644 --- a/services/Dockerfile +++ b/services/Dockerfile @@ -1,4 +1,4 @@ -FROM nginx +FROM nginx:1.13.3-alpine RUN rm /etc/nginx/conf.d/default.conf COPY default.conf /etc/nginx/conf.d/default.conf diff --git a/services/start.sh b/services/start.sh index fc0ce3c9..9f1d628f 100755 --- a/services/start.sh +++ b/services/start.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/usr/bin/env sh # NGINX doesn't let you use ENV vars within the conf file. # We use sed to set the env vars we need.