diff --git a/README.md b/README.md index 2724e99049..df0e6c9b5f 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml deleted file mode 100644 index 3091218e80..0000000000 --- a/docker-compose.dev.yml +++ /dev/null @@ -1,51 +0,0 @@ -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 - env_file: - - docker/dev.env - build: - context: ./ - dockerfile: docker/dev/django/Dockerfile - ports: - - "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/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: development - ports: - - "8888:8888" - depends_on: - - django diff --git a/docker-compose.yml b/docker-compose.yml index 2ef8b10d3f..8777284662 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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 diff --git a/docker/dev/nodejs/.dockerignore b/docker/dev/nodejs/.dockerignore deleted file mode 100644 index 93f1361991..0000000000 --- a/docker/dev/nodejs/.dockerignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules -npm-debug.log diff --git a/docker/dev/nodejs/Dockerfile b/docker/dev/nodejs/Dockerfile index 67b3eebc83..67a2668836 100644 --- a/docker/dev/nodejs/Dockerfile +++ b/docker/dev/nodejs/Dockerfile @@ -1,16 +1,12 @@ -FROM ubuntu:14.04 -MAINTAINER CloudCV +FROM node:8.11.1 +MAINTAINER EvalAI Team 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 @@ -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 @@ -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 diff --git a/docs/source/setup.md b/docs/source/setup.md index 3282a5185a..875f4c214d 100644 --- a/docs/source/setup.md +++ b/docs/source/setup.md @@ -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