Skip to content

Commit

Permalink
feat: improve codespace init time & experience
Browse files Browse the repository at this point in the history
  • Loading branch information
darmalovan committed Oct 15, 2024
1 parent 9c8082d commit 8dcb65c
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 13 deletions.
7 changes: 6 additions & 1 deletion .devcontainer/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,9 @@ echo "export CODESPACE_WDS_SOCKET_PORT=443" >> ~/.bashrc
echo "printf \"\n\n☁️☁️☁️️ Anythink: Develop in the Cloud ☁️☁️☁️\n\"" >> ~/.bashrc
echo "printf \"\n\x1b[31m \x1b[1m👉 Type: \\\`docker compose up\\\` to run the project. 👈\n\n\"" >> ~/.bashrc

nohup bash -c "cd /wilco-agent && node agent.js &" >> /tmp/agent.log 2>&1
nohup bash -c "cd /wilco-agent && node agent.js &" >> /tmp/agent.log 2>&1

if command -v docker-compose &> /dev/null
then
docker compose pull
fi
6 changes: 3 additions & 3 deletions .framework/java/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
anythink-backend-java:
build: ./backend
image: public.ecr.aws/v0a2l7y2/wilco/anythink-backend-java:latest
container_name: anythink-backend-java
command: sh -c "cd backend && /wait-for-it.sh postgres-java:5432 -q -t 60 && ./start.sh"

Expand All @@ -17,9 +17,9 @@ services:
- "postgres-java"

anythink-frontend-react:
build: ./frontend
image: public.ecr.aws/v0a2l7y2/wilco/anythink-frontend-react:latest
container_name: anythink-frontend-react
command: sh -c "cd frontend && yarn install && /wait-for-it.sh anythink-backend-java:3000 -t 120 --strict -- curl --head -X GET --retry 30 --retry-connrefused --retry-delay 1 anythink-backend-java:3000/api/ping && yarn start"
command: sh -c "cd frontend && /wait-for-it.sh anythink-backend-java:3000 -t 120 --strict -- curl --head -X GET --retry 30 --retry-connrefused --retry-delay 1 anythink-backend-java:3000/api/ping && yarn start"
environment:
- NODE_ENV=development
- PORT=3001
Expand Down
8 changes: 4 additions & 4 deletions .framework/node/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
services:
anythink-backend-node:
build: ./backend
image: public.ecr.aws/v0a2l7y2/wilco/anythink-backend-node:latest
container_name: anythink-backend-node
command: sh -c "cd backend && yarn install && /wait-for-it.sh mongodb-node:27017 -q -t 60 && yarn dev"
command: sh -c "cd backend && /wait-for-it.sh mongodb-node:27017 -q -t 60 && yarn dev"

environment:
- NODE_ENV=development
Expand All @@ -19,9 +19,9 @@ services:
- "mongodb-node"

anythink-frontend-react:
build: ./frontend
image: public.ecr.aws/v0a2l7y2/wilco/anythink-frontend-react:latest
container_name: anythink-frontend-react
command: sh -c "cd frontend && yarn install && /wait-for-it.sh anythink-backend-node:3000 -t 120 --strict -- curl --head -X GET --retry 30 --retry-connrefused --retry-delay 1 anythink-backend-node:3000/api/ping && yarn start"
command: sh -c "cd frontend && /wait-for-it.sh anythink-backend-node:3000 -t 120 --strict -- curl --head -X GET --retry 30 --retry-connrefused --retry-delay 1 anythink-backend-node:3000/api/ping && yarn start"
environment:
- NODE_ENV=development
- PORT=3001
Expand Down
5 changes: 3 additions & 2 deletions .framework/python/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
services:
anythink-backend-python:
build: ./backend
image: public.ecr.aws/v0a2l7y2/wilco/anythink-backend-python:latest
container_name: anythink-backend-python
command: >
sh -c "cd backend &&
Expand All @@ -24,9 +25,9 @@ services:
- "postgres-python"

anythink-frontend-react:
build: ./frontend
image: public.ecr.aws/v0a2l7y2/wilco/anythink-frontend-react:latest
container_name: anythink-frontend-react
command: sh -c "cd frontend && yarn install && /wait-for-it.sh anythink-backend-python:3000 -t 120 --strict -- curl --head -X GET --retry 30 --retry-connrefused --retry-delay 1 anythink-backend-python:3000/api/ping && yarn start"
command: sh -c "cd frontend && /wait-for-it.sh anythink-backend-python:3000 -t 120 --strict -- curl --head -X GET --retry 30 --retry-connrefused --retry-delay 1 anythink-backend-python:3000/api/ping && yarn start"
environment:
- NODE_ENV=development
- PORT=3001
Expand Down
6 changes: 3 additions & 3 deletions .framework/rails/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
anythink-backend-rails:
build: ./backend
image: public.ecr.aws/v0a2l7y2/wilco/anythink-backend-rails:latest
container_name: anythink-backend-rails
command: sh -c "cd backend && bundle install && /wait-for-it.sh postgres-rails:5432 -q -t 60 && ./start_rails.sh"

Expand All @@ -18,9 +18,9 @@ services:
- "postgres-rails"

anythink-frontend-react:
build: ./frontend
image: public.ecr.aws/v0a2l7y2/wilco/anythink-frontend-react:latest
container_name: anythink-frontend-react
command: sh -c "cd frontend && yarn install && /wait-for-it.sh anythink-backend-rails:3000 -t 120 --strict -- curl --head -X GET --retry 30 --retry-connrefused --retry-delay 1 anythink-backend-rails:3000/api/ping && yarn start"
command: sh -c "cd frontend && /wait-for-it.sh anythink-backend-rails:3000 -t 120 --strict -- curl --head -X GET --retry 30 --retry-connrefused --retry-delay 1 anythink-backend-rails:3000/api/ping && yarn start"
environment:
- NODE_ENV=development
- PORT=3001
Expand Down

0 comments on commit 8dcb65c

Please sign in to comment.