-
Notifications
You must be signed in to change notification settings - Fork 0
/
run-dev.sh
45 lines (36 loc) · 1.05 KB
/
run-dev.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
set -e
# Variables
project_dir="$(pwd)/client"
container_dir="/app"
pod_name="vuerastic_dev"
# Create the pod
echo "Creating pod..."
podman pod create --name $pod_name -p 8080:80
echo "Pod created."
# Create a named volume for node_modules
echo "Creating named volume for node_modules..."
podman volume create my_node_modules
echo "Named volume created."
# Build the client and nginx images
echo "Building client image..."
podman build -t client "./client"
echo "Client image built."
echo "Building nginx image..."
podman build -t nginx "./.nginx"
echo "Nginx image built."
# Run the client container with the generated volume mounts
echo "Running client container..."
podman run -dt \
--pod $pod_name \
--name client-dev \
-v $project_dir:$container_dir \
-v my_node_modules:$container_dir/node_modules \
client
echo "Client container running."
# Run the nginx container
echo "Running nginx container..."
podman run -dt --pod $pod_name --name nginx-dev -e APP_ENV=development nginx
echo "Nginx container running."
# Exit the script
exit 0