|
|
@ -11,6 +11,7 @@ DEV_LISTEN="${DEV_LISTEN:-127.0.0.1:8080}"
|
|
|
|
[[ "${DEV_LISTEN}" == *:* ]] || DEV_LISTEN="127.0.0.1:${DEV_LISTEN}"
|
|
|
|
[[ "${DEV_LISTEN}" == *:* ]] || DEV_LISTEN="127.0.0.1:${DEV_LISTEN}"
|
|
|
|
DEV_ADMIN="${DEV_ADMIN:-admin@example.com}"
|
|
|
|
DEV_ADMIN="${DEV_ADMIN:-admin@example.com}"
|
|
|
|
DEV_PASSWORD="${DEV_PASSWORD:-letmein}"
|
|
|
|
DEV_PASSWORD="${DEV_PASSWORD:-letmein}"
|
|
|
|
|
|
|
|
DEV_ARGS=( "$@" )
|
|
|
|
|
|
|
|
|
|
|
|
### MAIN
|
|
|
|
### MAIN
|
|
|
|
|
|
|
|
|
|
|
@ -90,7 +91,8 @@ EOF
|
|
|
|
|
|
|
|
|
|
|
|
# build
|
|
|
|
# build
|
|
|
|
chmod -R u+rwX,go+rX .
|
|
|
|
chmod -R u+rwX,go+rX .
|
|
|
|
"${docker}" build --tag "${DEV_NAME}:latest" .
|
|
|
|
echo Running: "${docker/*\/}" build --tag "${DEV_NAME}:latest" "${DEV_ARGS[@]}" .
|
|
|
|
|
|
|
|
"${docker}" build --tag "${DEV_NAME}:latest" "${DEV_ARGS[@]}" .
|
|
|
|
|
|
|
|
|
|
|
|
# gather volumes to map into container
|
|
|
|
# gather volumes to map into container
|
|
|
|
volumes=()
|
|
|
|
volumes=()
|
|
|
@ -110,6 +112,7 @@ done
|
|
|
|
cat <<EOF
|
|
|
|
cat <<EOF
|
|
|
|
|
|
|
|
|
|
|
|
=============================================================================
|
|
|
|
=============================================================================
|
|
|
|
|
|
|
|
|
|
|
|
The "${DEV_NAME}" container was built using this configuration:
|
|
|
|
The "${DEV_NAME}" container was built using this configuration:
|
|
|
|
|
|
|
|
|
|
|
|
DEV_NAME="${DEV_NAME}"
|
|
|
|
DEV_NAME="${DEV_NAME}"
|
|
|
@ -118,19 +121,34 @@ DEV_PROFILER="${DEV_PROFILER}"
|
|
|
|
DEV_LISTEN="${DEV_LISTEN}"
|
|
|
|
DEV_LISTEN="${DEV_LISTEN}"
|
|
|
|
DEV_ADMIN="${DEV_ADMIN}"
|
|
|
|
DEV_ADMIN="${DEV_ADMIN}"
|
|
|
|
DEV_PASSWORD="${DEV_PASSWORD}"
|
|
|
|
DEV_PASSWORD="${DEV_PASSWORD}"
|
|
|
|
=============================================================================
|
|
|
|
DEV_ARGS=( ${DEV_ARGS[*]} )
|
|
|
|
|
|
|
|
|
|
|
|
=============================================================================
|
|
|
|
=============================================================================
|
|
|
|
You can start the container later using this commandline:
|
|
|
|
|
|
|
|
|
|
|
|
You can start the container later using this command:
|
|
|
|
|
|
|
|
|
|
|
|
${docker/*\/} run --rm -it --name "${DEV_NAME}" --publish ${DEV_LISTEN}:8080$(printf " %q" "${volumes[@]}") "${DEV_NAME}"
|
|
|
|
${docker/*\/} run --rm -it --name "${DEV_NAME}" --publish ${DEV_LISTEN}:8080$(printf " %q" "${volumes[@]}") "${DEV_NAME}"
|
|
|
|
=============================================================================
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
=============================================================================
|
|
|
|
=============================================================================
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Enter the running container using this command:
|
|
|
|
|
|
|
|
${docker/*\/} exec -it "${DEV_NAME}" /bin/bash
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
=============================================================================
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
To update requirements-prod.txt you can build (and test) using:
|
|
|
|
|
|
|
|
${docker/*\/} build --tag "${DEV_NAME}:latest" --build-arg MAILU_DEPS=dev .
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
And then fetch the new dependencies with:
|
|
|
|
|
|
|
|
${docker/*\/} exec "${DEV_NAME}" pip freeze >$(realpath "${base}")/requirements-new.txt
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
=============================================================================
|
|
|
|
|
|
|
|
|
|
|
|
The Mailu UI can be found here: http://${DEV_LISTEN}/sso/login
|
|
|
|
The Mailu UI can be found here: http://${DEV_LISTEN}/sso/login
|
|
|
|
EOF
|
|
|
|
EOF
|
|
|
|
[[ -z "${DEV_DB}" ]] && echo "You can log in with user ${DEV_ADMIN} and password ${DEV_PASSWORD}"
|
|
|
|
[[ -z "${DEV_DB}" ]] && echo "You can log in with user ${DEV_ADMIN} and password ${DEV_PASSWORD}"
|
|
|
|
cat <<EOF
|
|
|
|
cat <<EOF
|
|
|
|
|
|
|
|
|
|
|
|
=============================================================================
|
|
|
|
=============================================================================
|
|
|
|
|
|
|
|
|
|
|
|
Starting mailu dev environment...
|
|
|
|
Starting mailu dev environment...
|
|
|
|