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

Update docker container versions #236

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all 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: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jarbas/frontend/tests/Doc/
jarbas/frontend/tests/elm-package.json
node_modules/
staticfiles/
assets/
Copy link
Collaborator

Choose a reason for hiding this comment

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

AFAIK assets was supposed to be a Docker volume, not an actual directory in project root. Can you refresh my memory here, @lipemorais?

This might me relevant as Django will collect files to ./staticfiles/ (which already exists in the pipeline) — so unifying in one directory might be better than creating a new one…


# vim stuff
*.swp
5 changes: 3 additions & 2 deletions Dockerfile-elm
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
FROM node:6.9.1
FROM node:8.3.0-slim

RUN npm install yarn
RUN npm install gulp yarn -D
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is -D still a shortcut for --save-dev? If so this might actually change a file in the project root — which might not be expected.

Also related to that error you've asked in PVT, something like gulp not found, installing yarn and gulp as global might be an option.

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

COPY yarn.lock yarn.lock
COPY package.json package.json
COPY elm-package.json elm-package.json
COPY gulpfile.js gulpfile.js
RUN npm install
RUN yarn install --pure-lockfile

COPY jarbas jarbas
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile-nginx
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
FROM nginx:1.11.5
FROM nginx:1.13.3-alpine
COPY contrib/nginx.docker /etc/nginx/conf.d/default.conf
RUN mkdir -p /opt/jarbas
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -291,4 +291,4 @@ If **you are not** using Docker copy `contrib/.env.sample` as `.env` in the proj
* `TWITTER_ACCESS_SECRET` (_str_) Twitter access token secret

To get this credentials follow [`python-twitter`
instructions](https://python-twitter.readthedocs.io/en/latest/getting_started.html#getting-your-application-tokens).
instructions](https://python-twitter.readthedocs.io/en/latest/getting_started.html#getting-your-application-tokens).
69 changes: 34 additions & 35 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,67 +1,66 @@
version: '2'
version: "3"
services:
cache:
image: memcached:1.5.0-alpine

elm:
image: datasciencebr/jarbas-frontend
volumes:
- .:/code
- ./assets:/code/jarbas/frontend/static
command: [yarn, watch]

jarbas:
image: datasciencebr/jarbas-backend
volumes:
- "assets:/code/staticfiles"
- "./:/code"
- ".env:/code/.env"
- ./assets:/code/staticfiles
- .:/code
- ./.env:/code/.env
environment:
- SECRET_KEY=lets-rock
- 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
- ALLOWED_HOSTS=localhost,127.0.0.1
- AMAZON_S3_BUCKET=serenata-de-amor-data
- AMAZON_S3_CEAPTRANSLATION_DATE=2016-08-08
- AMAZON_S3_REGION=s3-sa-east-1
- CACHE_BACKEND=django.core.cache.backends.memcached.MemcachedCache
- CACHE_LOCATION=cache:11211
- DATABASE_URL=postgres://jarbas:mysecretpassword@db/jarbas
- DEBUG=True
- GOOGLE_STREET_VIEW_API_KEY
- SECRET_KEY=lets-rock

depends_on:
- elm
- db
- cache
- elm
- db
- cache
networks:
backend:
frontend:
aliases:
- apps

elm:
image: datasciencebr/jarbas-frontend
volumes:
- "./:/code"
- "/code/node_modules"
- "assets:/code/jarbas/frontend/static"
command: [yarn, watch]

nginx:
image: datasciencebr/jarbas-server
volumes:
- "assets:/opt/jarbas/staticfiles"
- ./assets:/opt/jarbas/staticfiles
ports:
- "8000:80"
- 8000:80
depends_on:
- "jarbas"
- jarbas
networks:
- frontend

db:
image: postgres:9.6
image: postgres:9.6.4
environment:
- POSTGRES_PASSWORD=mysecretpassword
- POSTGRES_USER=jarbas
- POSTGRES_DB=jarbas
ports:
- "5432:5432"
- 5432:5432
networks:
- backend
- backend
volumes:
- "db:/var/lib/postgresql"

cache:
image: memcached:1.4
- ./db:/var/lib/postgresql

volumes:
assets:
Expand Down
Loading