-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun-dev.sh
More file actions
executable file
·53 lines (47 loc) · 1.64 KB
/
run-dev.sh
File metadata and controls
executable file
·53 lines (47 loc) · 1.64 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/bash
# Stop and remove any existing container first
echo "Cleaning up existing container..."
docker stop branhoff-web-dev 2>/dev/null || true
docker rm branhoff-web-dev 2>/dev/null || true
# Build the development image
echo "Building web development container..."
if ! docker build -f Dockerfile.dev -t web-dev:latest .; then
echo "Build failed! Exiting..." >&2
exit 1
fi
# Debug: Show what we're mounting
echo "================================================================"
echo "Current directory: $(pwd)"
echo "Files in current directory:"
ls -la
echo "================================================================"
echo "Starting web development container..."
echo "Access your site at:"
echo " - http://localhost:8000 (basic server)"
echo " - http://localhost:8080 (live-reload server)"
echo ""
echo "To access the container shell:"
echo " docker exec -it branhoff-web-dev /bin/zsh"
echo ""
echo "Inside the container, use:"
echo " webdev live # Start live-reload server"
echo " webdev serve # Start basic server"
echo " webdev format # Format your code"
echo "================================================================"
# Run container with volume mounting
if ! docker run -d \
--name branhoff-web-dev \
-p 8000:8000 \
-p 8080:8080 \
-v "$(pwd):/home/devuser/workspace" \
web-dev:latest; then
echo "Failed to start container! Exiting..." >&2
exit 1
fi
echo "Container started! Basic server running on port 8000."
echo ""
echo "Verify the mount worked:"
echo " docker exec branhoff-web-dev ls -la /home/devuser/workspace"
echo ""
echo "Access the shell:"
echo " docker exec -it branhoff-web-dev /bin/zsh"