-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdssh.sh
More file actions
executable file
·38 lines (35 loc) · 780 Bytes
/
dssh.sh
File metadata and controls
executable file
·38 lines (35 loc) · 780 Bytes
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
#!/bin/sh
if [ -z "$NODE_VERSION" ]; then
export NODE_VERSION=10
fi
if [ -f "docker-compose.yml" ]; then
if [ -z "$1" ]; then
docker-compose run --rm app /bin/sh
else
docker-compose run --rm app $@
fi
else
echo "No docker-compose.yml was found."
if [ "$1" = "init" ]; then
echo "Creating one now..."
cat << EOF > docker-compose.yml
version: '3'
services:
app:
image: mhart/alpine-node:\${NODE_VERSION}
working_dir: /app
volumes:
- .:/app:cached
- node_modules-vol:/app/node_modules
command: npm start
ports:
# It's a good idea to only forward the ports you need. Add your own if required
- "3000:3000"
- "4000:4000"
- "8000:8000"
- "8080:8080"
volumes:
node_modules-vol:
EOF
fi
fi