Skip to content

Commit

Permalink
Removed irrelevant warnings + fixing run-offline in docker setup (opp…
Browse files Browse the repository at this point in the history
…ia#18756)

* fixing docker setup issue

* modified makefile

* modified makefile

* fixed docker irrelevant warnings + enhanced dev-server condition for server ready

* fixed docker irrelevant warnings + enhanced dev-server condition for server ready

* Update docker-compose.yml

* fixed run-offline command

* Update Dockerfile.backend

* fixed run-devserver

* fixed logs
  • Loading branch information
Shivkant-Chauhan authored Aug 18, 2023
1 parent a59b281 commit 8cfdef6
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 14 deletions.
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,16 @@ build: ## Builds the all docker services.
docker compose build

run-devserver: # Runs the dev-server
docker compose up dev-server -d
docker compose up dev-server -d --no-deps
$(MAKE) update.requirements
docker compose up angular-build -d
$(MAKE) update.package
$(MAKE) run-offline

run-offline: # Runs the dev-server in offline mode
docker compose up dev-server -d
@printf 'Please wait while the development server starts...\n\n'
@while [[ $$(curl -s -o /tmp/status_code.txt -w '%{http_code}' http://localhost:8181/community-library) != "200" ]]; do \
@while [[ $$(curl -s -o /tmp/status_code.txt -w '%{http_code}' http://localhost:8181) != "200" ]] || [[ $$(curl -s -o /tmp/status_code.txt -w '%{http_code}' http://localhost:8181/community-library) != "200" ]]; do \
sleep 5; \
done
@echo 'Development server started at port 8181.'
Expand Down
24 changes: 13 additions & 11 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ services:
- yarn_cache:/root/.yarn-cache
environment:
- NODE_OPTIONS=--max_old_space_size=4096
- prod_env=${prod_env}
- prod_env=${prod_env:-false}
entrypoint: bash /app/oppia/docker/angular-build.entrypoint.sh

webpack-compiler:
Expand All @@ -28,8 +28,8 @@ services:
- third_party:/app/oppia/third_party
- frontend_proto_files:/app/oppia/extensions/classifiers/proto
environment:
- prod_env=${prod_env}
- source_maps=${source_maps}
- prod_env=${prod_env:-false}
- source_maps=${source_maps:-false}
entrypoint: bash /app/oppia/docker/webpack-compiler.entrypoint.sh

dev-server:
Expand All @@ -45,15 +45,17 @@ services:
- proto_files:/app/oppia/proto_files
- frontend_proto_files:/app/oppia/extensions/classifiers/proto
- third_party:/app/oppia/third_party
- pip_cache:/root/.cache/pip
- pip_cache:/root/.cache
environment:
- CLOUDSDK_CORE_DISABLE_PROMPTS=1
- PIP_NO_DEPS=True
- prod_env=${prod_env}
- maintenance_mode=${maintenance_mode}
- source_maps=${source_maps}
- disable_host_checking=${disable_host_checking}
- no_auto_restart=${no_auto_restart}
- PIP_NO_INDEX=True
- PIP_FIND_LINKS=/root/.cache
- prod_env=${prod_env:-false}
- maintenance_mode=${maintenance_mode:-false}
- source_maps=${source_maps:-false}
- disable_host_checking=${disable_host_checking:-false}
- no_auto_restart=${no_auto_restart:-false}
depends_on:
- angular-build
- webpack-compiler
Expand All @@ -77,7 +79,7 @@ services:
environment:
- CLOUDSDK_CORE_DISABLE_PROMPTS=1
- DATASTORE_HOST=datastore
- save_datastore=${save_datastore}
- save_datastore=${save_datastore:-false}
volumes:
- cloud_datastore_emulator_cache:/app/cloud_datastore_emulator_cache
- ./docker/datastore.entrypoint.sh:/app/oppia/docker/datastore.entrypoint.sh
Expand Down Expand Up @@ -111,7 +113,7 @@ services:
interval: 20s
retries: 5
environment:
- save_datastore=${save_datastore}
- save_datastore=${save_datastore:-false}
entrypoint: sh /app/oppia/docker/firebase.entrypoint.sh

redis:
Expand Down
4 changes: 3 additions & 1 deletion docker/Dockerfile.backend
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,10 @@ RUN chmod -R 744 $BUF_DIR \
COPY requirements.txt .
COPY requirements_dev.txt .

RUN pip install --require-hashes --no-deps -r requirements.txt
RUN pip install --require-hashes --no-deps -r requirements.txt -t /app/oppia/third_party/python_libs
RUN pip install --require-hashes --no-deps -r requirements_dev.txt
RUN pip download --no-deps -r requirements.txt -d /root/.cache
RUN pip download --no-deps -r requirements_dev.txt -d /root/.cache

# Installing buf and proto for Linux -- this docker container is based on Linux
COPY buf.gen.yaml .
Expand Down

0 comments on commit 8cfdef6

Please sign in to comment.