Skip to content

Commit

Permalink
Feature/apline (#227)
Browse files Browse the repository at this point in the history
* updating node to alpine

* updating nginx to alpine

* updating api to alpine

* bash -> sh

* bash -> sh

* bash -> sh

* bash -> sh

* bash -> sh

* adding a comment about mariadb

* bash -> sh
  • Loading branch information
RyanNoelk authored Aug 14, 2017
1 parent 7c6c447 commit 4906372
Show file tree
Hide file tree
Showing 12 changed files with 35 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 4 additions & 1 deletion api/Dockerfile
Original file line number Diff line number Diff line change
@@ -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/
4 changes: 2 additions & 2 deletions api/base/gunicorn_start.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env sh

NAME="OpenEats" # Name of the application
DJANGODIR=/code # Django project directory
Expand All @@ -21,4 +21,4 @@ exec gunicorn ${DJANGO_WSGI_MODULE}:application \
--name $NAME \
--workers $NUM_WORKERS \
--user=$USER --group=$GROUP \
--bind=$API_URL
--bind=$API_URL
4 changes: 2 additions & 2 deletions api/tests.sh
Original file line number Diff line number Diff line change
@@ -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
python manage.py test -k
2 changes: 1 addition & 1 deletion docker-compose-test.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '2'
services:
api:
command: bash tests.sh
command: sh tests.sh
build: api/
volumes:
- static-files:/code/static-files
Expand Down
2 changes: 1 addition & 1 deletion docs/React_i18n.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
2 changes: 1 addition & 1 deletion docs/Running_the_App.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 3 additions & 5 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:argon
FROM node:8.3.0-alpine

# Create app directory
RUN mkdir /code
Expand All @@ -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
# Run Yarn to install all dependencies
RUN yarn install --pure-lockfile
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
22 changes: 17 additions & 5 deletions frontend/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand All @@ -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"
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion services/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion services/start.sh
Original file line number Diff line number Diff line change
@@ -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.
Expand Down

0 comments on commit 4906372

Please sign in to comment.