Skip to content

Commit

Permalink
chore: implement Rust to the dev environment (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmyna committed Feb 6, 2025
1 parent ab52c18 commit 80d2008
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 5 deletions.
6 changes: 5 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ services:
- 27017:27017
app:
build: .
user: root
user: ifhany
container_name: ifhany_app
ports:
- 2129:2129
Expand All @@ -27,6 +27,10 @@ services:
- ifhany_net
depends_on:
- database

# Please, these values are only for development. Don't be an idiot.
cap_add:
- SYS_PTRACE
security_opt:
- seccomp=unconfined
volumes:
Expand Down
20 changes: 19 additions & 1 deletion scripts/dev
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
#!/bin/bash

docker rm ifhany_db; docker-compose -f docker-compose.yml -f config/docker-compose_dev.yml up --build --remove-orphans
docker rm ifhany_db; docker compose -f docker-compose.yml -f config/docker-compose_dev.yml up -d

echo "Starting dev mode";

STARTED=false
TRIES=1
while [ $STARTED = false ]; do
sleep 1;

echo "Waiting for dev mode to start... ($TRIES)";

if docker ps | grep -q ifhany_app; then
STARTED=true;
fi

TRIES=$((TRIES + 1))
done

dockersh ifhany_app
10 changes: 7 additions & 3 deletions scripts/on-container_dev-init.bash
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@ case "$1" in
"--no-build")
;;
*)
cargo run --bin prisma generate
#cargo run --bin prisma -- generate
;;
esac

rustup default stable

cargo build
#cargo build

lldb-server g 0.0.0.0:2129 -- /app/target/debug/ifhany
#lldb-server g 0.0.0.0:2129 -- /app/target/debug/ifhany

while true; do
sleep 5;
done

0 comments on commit 80d2008

Please sign in to comment.