#!/bin/bash # # Same as the Makefile, but as a bash script, see Makefile for detailed explanation. # CONTAINER_NAME=web echo "preparing bash environment..." docker-compose exec $CONTAINER_NAME bash -c "grep '^$(whoami):' /etc/passwd >/dev/null || useradd -m '$(whoami)' --uid=$(id -u) -G www-data -s /bin/bash" docker-compose exec $CONTAINER_NAME bash -c "sed -i 's/#force_color_prompt=yes/force_color_prompt=yes/' /home/$(whoami)/.bashrc" echo -e "\nYou are now in the \033[1m$CONTAINER_NAME\033[0m container.\n" docker-compose exec --user=$(id -u) $CONTAINER_NAME bash