Skip to content
This repository has been archived by the owner on Feb 28, 2018. It is now read-only.

Make Docker great again #163

Merged
merged 13 commits into from
May 17, 2017
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ COPY requirements.txt /requirements.txt
RUN python -m pip install -U pip
RUN python -m pip install -r requirements.txt
RUN apt-get update && apt-get install -y postgresql postgresql-contrib
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In theory we were installing PostgreSQL because pyscopg2 (PostgreSQL driver for Python) needs one or other library that comes with PostgreSQL. If this apt-get is coming after pip this might not be necessary anymore.

TLDR IMHO we can get rid of line 5

COPY .env /code/.env
COPY manage.py /code/manage.py
COPY jarbas /code/jarbas
WORKDIR /code
Expand Down
9 changes: 3 additions & 6 deletions Dockerfile-elm
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
FROM node:6.9.1

RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
RUN sudo apt-get update
RUN sudo apt-get install yarn

RUN npm install yarn
RUN ln -s /node_modules/yarn/bin/yarn.js /usr/bin/yarn
WORKDIR /code

COPY yarn.lock yarn.lock
Expand All @@ -14,4 +11,4 @@ COPY gulpfile.js gulpfile.js
RUN yarn install --pure-lockfile

COPY jarbas jarbas
CMD yarn assets
CMD ["yarn", "assets"]
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
run.jarbas:
docker-compose up -d --build
docker-compose up -d
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We must reflect this change in README.md before merging

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed: 8b73b79

docker-compose run --rm jarbas python manage.py ceapdatasets
docker-compose run --rm jarbas python manage.py migrate

Expand Down
22 changes: 12 additions & 10 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
version: '2'
services:
jarbas:
build:
context: .
dockerfile: Dockerfile
image: felipedemorais/auto-jarbas
volumes:
- "staticfiles:/code/staticfiles"
- "assets:/code/staticfiles"
- "./:/code"
- ".env:/code/.env"
environment:
- SECRET_KEY=lets-rock
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's extremely unsafe to use this for production. As the focus is development environment this is not a problem right now… but I decided to let this note here so we can (later) take care of that and of GOOGLE_STREET_VIEW_API_KEY ; )

- DATABASE_URL=postgres://jarbas:mysecretpassword@db/jarbas
- CACHE_BACKEND=django.core.cache.backends.memcached.MemcachedCache
- CACHE_LOCATION=cache:11211
- DEBUG=True
- ALLOWED_HOSTS=localhost,127.0.0.1
- AMAZON_S3_BUCKET=serenata-de-amor-data
- AMAZON_S3_REGION=s3-sa-east-1
- AMAZON_S3_CEAPTRANSLATION_DATE=2016-08-08
- GOOGLE_STREET_VIEW_API_KEY=my-google-places-api-key

depends_on:
- elm
- db
Expand All @@ -24,18 +29,15 @@ services:
- apps

elm:
build:
context: .
dockerfile: Dockerfile-elm
image: felipedemorais/auto-jarbas-frontend
volumes:
- "./:/code"
- "/code/node_modules"
- "assets:/code/jarbas/frontend/static"
command: [yarn, watch]

nginx:
build:
context: .
dockerfile: Dockerfile-nginx
image: felipedemorais/aut-jarbas-nginx
volumes:
- "assets:/opt/jarbas/staticfiles"
ports:
Expand Down