Skip to content

Commit

Permalink
Docker: Update project setup using docker (#1646)
Browse files Browse the repository at this point in the history
  • Loading branch information
deshraj authored Apr 10, 2018
1 parent bfaa23e commit bbfceee
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 84 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ You can also use Docker Compose to run all the components of EvalAI together. Th
3. Build and run the Docker containers. This might take a while. You should be able to access EvalAI at `localhost:8888`.

```
docker-compose -f docker-compose.dev.yml up -d --build
docker-compose up --build
```

### Using Virtual Environment
Expand Down
51 changes: 0 additions & 51 deletions docker-compose.dev.yml

This file was deleted.

58 changes: 42 additions & 16 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,53 @@
version: "2"
services:

db:
image: postgres
ports:
- "5432:5432"

rabbitmq:
image: rabbitmq
hostname: rabbitmq
ports:
- "5672:5672"
- "15672:15672" # here, we can access rabbitmq management plugin

django:
container_name: django
hostname: django
build:
env_file:
- docker/dev.env
build:
context: ./
dockerfile: docker/prod/django/Dockerfile
command: /code/docker/prod/django/container-start.sh
dockerfile: docker/dev/django/Dockerfile
ports:
- "8000:8000"
volumes:
- .:/code
node-nginx:
container_name: node-nginx
hostname: node-nginx
- "8000:8000"
command: ["./docker/wait-for-it.sh", "db:5432", "--", "sh", "/code/docker/dev/django/container-start.sh"]
depends_on:
- "db"

submission-worker:
env_file:
- docker/dev.env
build:
context: ./
dockerfile: docker/prod/node-nginx/Dockerfile
command: /code/docker/prod/node-nginx/container-start.sh
dockerfile: docker/dev/rabbitmq/Dockerfile
command: ["./docker/wait-for-it.sh", "django:8000", "--", "python", "scripts/workers/submission_worker.py"]
depends_on:
- "django"

nodejs:
container_name: nodejs
hostname: nodejs
build:
context: ./
dockerfile: docker/dev/nodejs/Dockerfile
environment:
NODE_ENV: production
NODE_ENV: development
ports:
- "80:80"
- "8080:8080"
depends_on:
- django
- '8888:8888'
volumes:
- .:/code
- /code/node_modules
- /code/bower_components
2 changes: 0 additions & 2 deletions docker/dev/nodejs/.dockerignore

This file was deleted.

19 changes: 6 additions & 13 deletions docker/dev/nodejs/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
FROM ubuntu:14.04
MAINTAINER CloudCV
FROM node:8.11.1
MAINTAINER EvalAI Team <[email protected]>

RUN apt-get update -qq && apt-get install -y build-essential git curl libfontconfig
RUN apt-get install nodejs-legacy -y
RUN apt-get install npm -y
RUN apt-get install -y ruby-dev
RUN gem install sass -v 3.2.19
RUN apt-get update

RUN mkdir /code

# Add dependencies
ADD ./frontend /code/frontend
ADD ./package.json /code
ADD ./bower.json /code
ADD ./gulpfile.js /code
Expand All @@ -19,12 +15,8 @@ ADD ./karma.conf.js /code

WORKDIR /code

# Bypass the ssl check
RUN npm config set strict-ssl false

# Install Prerequisites
RUN npm install bower -g
RUN npm install gulp -g
RUN npm install -g bower gulp

RUN npm link gulp

Expand All @@ -34,7 +26,8 @@ RUN n stable
RUN npm install
RUN bower install --allow-root

# Set the command to run on startup
ADD . /code

CMD ["gulp", "dev:runserver"]

EXPOSE 8888
2 changes: 1 addition & 1 deletion docs/source/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ We recommend setting up EvalAI using Docker since there are only two steps invol
2. Build and run the Docker containers. This might take a while. You should be able to access EvalAI at `localhost:8888`.

```
docker-compose -f docker-compose.dev.yml up -d --build
docker-compose up --build
```

## Ubuntu Installation Instructions
Expand Down

0 comments on commit bbfceee

Please sign in to comment.