Browse Source

feat: add compose file and setup script

master
Dennis Buchhorn 3 years ago
parent
commit
7b6d6ca9b9
2 changed files with 92 additions and 0 deletions
  1. +12
    -0
      docker-compose.yml
  2. +80
    -0
      setup

+ 12
- 0
docker-compose.yml View File

@ -0,0 +1,12 @@
version: "3.5"
services:
kimai:
container_name: ${TYPO3_CONTAINER_NAME:-typo3}
image: martinhelmich/typo3:${TYPO3_VERSION:-latest}
restart: unless-stopped
ports:
- ${TYPO3_HOST_IP_ADDRESS:-127.0.0.1}:${TYPO3_HOST_PORT:-8001}:8001
volumes:
- .fileadmin:/var/www/html/fileadmin
- .typo3conf:/var/www/html/typo3conf
- .uploads:/var/www/html/uploads

+ 80
- 0
setup View File

@ -0,0 +1,80 @@
#!/bin/bash
echo "####################################################################"
echo "# docker_typo3_setup_script #"
echo "# Dennis Buchhorn - bucde@b-eit.de #"
echo "####################################################################"
echo "# WARNING: password is plain text input! #"
echo "# #"
echo "# Config will be saved in 'config' file. #"
echo "# (everything in plain text, even the password) #"
#echo "# #"
echo "####################################################################"
echo ""
DATE=$(date +'%y%m%d%H%M%S')
CONFIG_EXISTS="false"
USE_EXISTING_CONFIG=""
DELETE_CONFIG=""
TYPO3_PROJECT_NAME="typo3_${DATE}"
TYPO3_PROJECT_NAME_SUFFIX=""
TYPO3_CONTAINER_NAME="${TYPO3_PROJECT_NAME}_core"
TYPO3_VERSION=""
TYPO3_HOST_IP_ADDRESS=""
TYPO3_HOST_PORT=""
read -p "Enter typo3 project name suffix (leave empty for none): " TYPO3_PROJECT_NAME_SUFFIX
if [ -n "$TYPO3_PROJECT_NAME_SUFFIX" ]; then
TYPO3_PROJECT_NAME="${TYPO3_PROJECT_NAME}_${TYPO3_PROJECT_NAME_SUFFIX}"
TYPO3_CONTAINER_NAME="${TYPO3_CONTAINER_NAME}_${TYPO3_PROJECT_NAME_SUFFIX}"
fi
rm -f .env
touch .env
echo "COMPOSE_PROJECT_NAME="$TYPO3_PROJECT_NAME >> .env
echo "TYPO3_CONTAINER_NAME="$TYPO3_CONTAINER_NAME >> .env
if [ -f "config" ]; then
CONFIG_EXISTS="true"
read -p "Config file 'config' already exists! Would you like to use this? (y/n)" USE_EXISTING_CONFIG
fi
if [ $CONFIG_EXISTS == "false" ] || [ $USE_EXISTING_CONFIG == "n" ]; then
read -p "Enter typo3 version which should be used: " TYPO3_VERSION
read -p "Enter host (vm) ip address on which typo3 should be accessible: " TYPO3_HOST_IP_ADDRESS
read -p "Enter host (vm) port on which typo3 should be accessible: " TYPO3_HOST_PORT
rm -f config
touch config
echo "TYPO3_VERSION="$TYPO3_VERSION >> config
echo "TYPO3_HOST_IP_ADDRESS="$TYPO3_HOST_IP_ADDRESS >> config
echo "TYPO3_HOST_PORT="$TYPO3_HOST_PORT >> config
echo "Config file 'config' created!"
else
echo "Use existing config file 'config'!"
fi
cat "config" >> ".env"
read -p "Should the config file 'config' be deleted after creating the container? (y/n)" DELETE_CONFIG
mkdir -p fileadmin typo3conf uploads
docker-compose up -d
echo -n "Wait until typo3 is ready ..."
#while [ "`docker inspect -f {{.State.Health.Status}} $KIMAI_CONTAINER_NAME`" != "healthy" ]; do
#echo -n "."
#sleep 1
#done
echo -e "\nTypo3 is ready!"
rm -f .env
echo "Done!"

Loading…
Cancel
Save