Skip to content

Commit

Permalink
Added fix for Docker file to see logs and installation doc
Browse files Browse the repository at this point in the history
  • Loading branch information
kshitijrajsharma committed Jul 27, 2023
1 parent 1b8a94a commit 35ef1e2
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 18 deletions.
3 changes: 1 addition & 2 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,4 @@ See below a suggested product roadmap [subject to change] that provides high-lev

## Local Installation [DEV]

Checkout Docker Installation [docs](./docs/Docker-installation.md)## Local Installation [DEV]

Checkout Docker Installation [docs](./docs/Docker-installation.md)
2 changes: 1 addition & 1 deletion backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ RUN pip install setuptools --upgrade
COPY requirements.txt requirements.txt
RUN pip install -r requirements.txt

RUN mkdir /app

WORKDIR /app
COPY . /app
20 changes: 12 additions & 8 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: '3.8'
version: "3.8"

services:
postgres:
Expand All @@ -10,8 +10,8 @@ services:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=admin
ports:
- '5434:5432'
- "5434:5432"

redis:
image: redis
container_name: redis
Expand All @@ -20,7 +20,7 @@ services:

backend-api:
build:
context: ./backend
context: ./backend
dockerfile: Dockerfile
container_name: api
command: python manage.py runserver 0.0.0.0:8000
Expand All @@ -33,6 +33,7 @@ services:
ports:
- 8000:8000
volumes:
- ./backend:/app
- ${RAMP_HOME}:/RAMP_HOME
- ${TRAINING_WORKSPACE}:/TRAINING_WORKSPACE
depends_on:
Expand All @@ -41,7 +42,7 @@ services:

backend-worker:
build:
context: ./backend
context: ./backend
dockerfile: Dockerfile
container_name: worker
command: celery -A aiproject worker --loglevel=INFO
Expand All @@ -52,6 +53,7 @@ services:
- driver: nvidia
capabilities: [gpu]
volumes:
- ./backend:/app
- ${RAMP_HOME}:/RAMP_HOME
- ${TRAINING_WORKSPACE}:/TRAINING_WORKSPACE
depends_on:
Expand All @@ -72,11 +74,13 @@ services:

frontend:
build:
context: ./frontend
context: ./frontend
dockerfile: Dockerfile.frontend
container_name: frontend
command: npm start -- --host 0.0.0.0 --port 3000
ports:
- 3000:3000
- 3000:3000
depends_on:
- backend-api
- backend-api
volumes:
- ./frontend:/app
16 changes: 9 additions & 7 deletions docs/Docker-installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ Docker Compose is created with redis , worker , postgis database , api and fron
```
eg : export RAMP_HOME=/home/kshitij/ramp

- Export ```TRAINING_WORKSPACE``` Env
Training workspace is the folder where fAIr will store its training files
for eg :
```
export TRAINING_WORKSPACE=/home/kshitij/hotosm/fAIr/trainings
```

5. Register your Local setup to OSM

- Go to [OpenStreetMap](https://www.openstreetmap.org/) , Login/Create Account
Expand All @@ -73,12 +80,7 @@ Docker Compose is created with redis , worker , postgis database , api and fron
- Fill out the details of ```OSM_CLIENT_ID``` &```OSM_CLIENT_SECRET``` in .env file and generate a unique key & paste it to ```OSM_SECRET_KEY``` (It can be random for dev setup)

Leave rest of the items as it is unless you know what you are doing
- Export ```TRAINING_WORKSPACE``` Env
Training workspace is the folder where fAIr will store its training files
for eg :
```
export TRAINING_WORKSPACE=/home/kshitij/hotosm/fAIr/trainings
```

- Create ```.env``` in /frontend
```
cp .env_sample .env
Expand Down Expand Up @@ -110,7 +112,7 @@ Docker Compose is created with redis , worker , postgis database , api and fron

python manage.py makemigrations
python manage.py makemigrations login
python manage.py makemigrations login
python manage.py makemigrations core
python manage.py migrate

9. Play and Develop
Expand Down

0 comments on commit 35ef1e2

Please sign in to comment.