forked from dandi/dandi-archive
-
Notifications
You must be signed in to change notification settings - Fork 1
/
admin_dev_startup.sh
executable file
·31 lines (22 loc) · 888 Bytes
/
admin_dev_startup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash
# This script can be used to launch the front-end and back-end applications locally.
# Happy developing!
if [ $# -lt 2 ]; then
echo "Usage: $0 <image_name> <[email protected]>"
exit 1
fi
image_name=$1
email=$2
cd web/
# Build Docker image (include the path to the Dockerfile's context)
docker build -t $image_name -f Dockerfile.dev .
# Run the Docker container for frontend in background
docker run -d -v "$(pwd):/usr/src/app" -v /usr/src/app/node_modules -p 8085:8085 -e CHOKIDAR_USEPOLLING=true $image_name
cd ..
# Run Docker Compose commands for backend
docker compose run --rm django ./manage.py migrate
docker compose run --rm django ./manage.py createcachetable
docker compose run --rm django ./manage.py createsuperuser
docker compose run --rm django ./manage.py create_dev_dandiset --owner $email
# Bring backend application to life!
docker compose up