Skip to content

Commit

Permalink
Minor docker setup improvements (#1689)
Browse files Browse the repository at this point in the history
  • Loading branch information
deshraj authored Jun 1, 2018
1 parent 463c6a6 commit e9840b5
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 32 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ coverage.xml

# Django stuff:
*.log
settings/dev.py

# Sphinx documentation
docs/_build/
Expand Down
19 changes: 13 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,21 +84,23 @@ You can also use Docker Compose to run all the components of EvalAI together. Th
pip install -r requirements/dev.txt
```
4. Rename `settings/dev.sample.py` as `dev.py` and change credential in `settings/dev.py`
4. Create an empty postgres database.
```
cp settings/dev.sample.py settings/dev.py
sudo -i -u (username)
createdb evalai
```
Use your postgres username and password for fields `USER` and `PASSWORD` in `dev.py` file.
5. Create an empty postgres database and run database migration.
5. Change Postgresql credentials in `settings/dev.py` and run migrations
Use your postgres username and password for fields `USER` and `PASSWORD` in `dev.py` file. After changing credentials, run migrations using the following command:
```
sudo -i -u (username)
createdb evalai
python manage.py migrate
```
6. Seed the database with some fake data to work with.
```
Expand All @@ -118,15 +120,20 @@ You can also use Docker Compose to run all the components of EvalAI together. Th


8. Please make sure that node(`>=7.x.x`), npm(`>=5.x.x`) and bower(`>=1.8.x`) are installed globally on your machine.

Install npm and bower dependencies by running

```
npm install
bower install
```

If you running npm install behind a proxy server, use

```
npm config set proxy http://proxy:port
```

9. Now to connect to dev server at [http://127.0.0.1:8888] (for serving frontend)

```
Expand Down
22 changes: 4 additions & 18 deletions docker/dev/django/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,27 +1,13 @@
FROM python:2.7
MAINTAINER CloudCV
ENV PYTHONUNBUFFERED 1

ENV DEBIAN_FRONTEND noninteractive

RUN apt-get update \
&& apt-get upgrade -y \
&& apt-get install -y

RUN apt-get install -y apt-utils

RUN groupadd webapps
RUN useradd evalai -G webapps
RUN mkdir -p /var/log/evalai/ && chown -R evalai /var/log/evalai/ && chmod -R u+rX /var/log/evalai/
RUN mkdir -p /var/run/evalai/ && chown -R evalai /var/run/evalai/ && chmod -R u+rX /var/run/evalai/
ENV PYTHONUNBUFFERED 1

RUN mkdir /code
WORKDIR /code

ADD ./ /code/

COPY settings/dev.sample.py /code/settings/dev.py
ADD requirements/* /code/

RUN pip install -r requirements/dev.txt
RUN pip install -r dev.txt

CMD ["./docker/wait-for-it.sh", "db:5432", "--", "sh", "/code/docker/dev/django/container-start.sh"]

Expand Down
2 changes: 0 additions & 2 deletions docker/dev/nodejs/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ RUN npm cache clean -f
RUN npm install
RUN bower install --allow-root

ADD . /code

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

EXPOSE 8888
9 changes: 4 additions & 5 deletions docker/dev/worker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
FROM python:2.7
MAINTAINER CloudCV
ENV PYTHONUNBUFFERED 1

RUN apt-get update && apt-get install -y python python-pip python-dev libpq-dev libjpeg-dev libyaml-dev libffi-dev
ENV PYTHONUNBUFFERED 1

RUN mkdir /code
ADD ./ /code/
WORKDIR /code

ADD requirements/* /code/

RUN pip install -U cffi service_identity
RUN pip install -r requirements/dev.txt
RUN pip install -r dev.txt

CMD ["./docker/wait-for-it.sh", "django:8000", "--", "python", "scripts/workers/submission_worker.py" ]
File renamed without changes.

0 comments on commit e9840b5

Please sign in to comment.