40 lines
628 B
Bash
40 lines
628 B
Bash
|
#!/usr/bin/env sh
|
||
|
|
||
|
printf "Project name: "
|
||
|
read -r PROJECT
|
||
|
|
||
|
mkdir -p "$PROJECT"
|
||
|
cd "$PROJECT" || exit
|
||
|
|
||
|
printf "Image name: "
|
||
|
read -r IMAGE
|
||
|
|
||
|
printf "App name (network alias): "
|
||
|
read -r NAME
|
||
|
|
||
|
printf "Enable watchtower [true/false]: "
|
||
|
read -r WATCHTOWER_ENABLE
|
||
|
|
||
|
cat <<EOF >"docker-compose.yml"
|
||
|
version: '3'
|
||
|
services:
|
||
|
app:
|
||
|
image: ${IMAGE}
|
||
|
restart: always
|
||
|
labels:
|
||
|
com.centurylinklabs.watchtower.enable: ${WATCHTOWER_ENABLE}
|
||
|
env_file:
|
||
|
- .env
|
||
|
- .secret.env
|
||
|
networks:
|
||
|
apps:
|
||
|
aliases:
|
||
|
- ${NAME}
|
||
|
|
||
|
networks:
|
||
|
apps:
|
||
|
external: true
|
||
|
EOF
|
||
|
|
||
|
vim -O2 "docker-compose.yml" ".env"
|