Skip to content

Commit

Permalink
feat(docker-config): add new ports and tokens
Browse files Browse the repository at this point in the history
refactor(docker-config): make environment variables optional
chore(docker-config): update container registry reference
fix(docker-config): correct command to run in Docker container
  • Loading branch information
entelecheia committed Aug 23, 2023
1 parent 5b60703 commit 1f35d2b
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 49 deletions.
7 changes: 6 additions & 1 deletion .copier-docker-config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Changes here will be overwritten by Copier; do NOT edit manually
_commit: v0.7.1-7-g77b2b48
_commit: v0.7.2-5-g5b60703
_src_path: .
app_clone_dirname: entelecheia/entelecheia
app_install_root: /workspace/projects
Expand Down Expand Up @@ -30,6 +30,8 @@ github_username: entelecheia
install_dotfiles: true
install_pip_requirements: true
jupyter_host_port: 18888
jupyter_port: 8585
jupyter_token: __juypter_token_(change_me)__
launch_scripts: launch.sh
project_description: 'Hyperfast Docker Template is an innovative project creation
tool that merges the flexibility of Docker with the simplicity of Copier to optimize
Expand Down Expand Up @@ -66,6 +68,9 @@ project_short_description: Hyperfast Docker Template is a powerful tool that lev
Docker configurations, fostering a highly efficient and user-friendly development
experience.
ssh_host_port: 2222
ssh_port: 22
start_jupyter: true
start_ssh_service: true
web_service_host_port: 18080
web_service_port: 8080

2 changes: 2 additions & 0 deletions .docker/docker-compose.base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ services:
ARG_USER_UID: $USER_UID
ARG_USER_GID: $USER_GID
ARG_WORKSPACE_ROOT: $CONTAINER_WORKSPACE_ROOT
ARG_WORKSPACE_LOCATION: $CONTAINER_WORKSPACE_LOCATION
ARG_SYSTEM_HOSTNAME: $CONTAINER_HOSTNAME
# Sets the image name for the built image
image: $IMAGE_NAME:$IMAGE_TAG
# Sets the hostname of the container
Expand Down
66 changes: 33 additions & 33 deletions .docker/docker.app.env
Original file line number Diff line number Diff line change
Expand Up @@ -2,62 +2,62 @@
# Configuration parameters for the docker project #
# Change the variables below to your need: #
#########################################################
APP_NAME="hyperfast-docker" # The name of the project
APP_VARIANT="app" # The variant of the project
APP_GITHUB_USERNAME="entelecheia" # The GitHub username of the project
APP_USER_FULLNAME="Young Joon Lee" # The full name of the user
APP_USER_EMAIL="entelecheia@hotmail.com" # The email address of the user
APP_SOURCE_REPO="entelecheia/entelecheia" # The GitHub repository name of the project
APP_SOURCE_BRANCH="main" # The branch of the project to clone
APP_INSTALL_ROOT="/workspace/projects" # The directory in the container where the project will be installed or cloned
APP_CLONE_DIRNAME="entelecheia/entelecheia" # The directory name for the cloned project
APP_SERVER_NAME="app" # The server name (optional, can be left empty)
APP_CUDA_DEVICE_ID="all" # The ID of the CUDA device to use, e.g. all, 0, 1, 2, etc.
APP_HOST_SSH_PORT="2222" # The SSH port on the host machine to be mapped to the container's SSH port
APP_HOST_JUPYTER_PORT="18585" # The Jupyter port on the host machine to be mapped to the container's Jupyter port
APP_JUPYTER_TOKEN="_devenv_jupyter_" # The Jupyter token to use
APP_HOST_WEB_SVC_PORT="18888" # The Web service port on the host machine to be mapped to the container's Web service port
GIT_COMMIT_GPGSIGN=${GIT_COMMIT_GPGSIGN:-"false"} # Whether to GPG-sign Git commits
APP_NAME="hyperfast-docker" # The name of the project
APP_VARIANT="app" # The variant of the project
APP_GITHUB_USERNAME=${APP_GITHUB_USERNAME:-"entelecheia"} # The GitHub username of the project
APP_USER_FULLNAME=${APP_USER_FULLNAME:-"Young Joon Lee"} # The full name of the user
APP_USER_EMAIL=${APP_USER_EMAIL:-"entelecheia@hotmail.com"} # The email address of the user
APP_SOURCE_REPO=${APP_SOURCE_REPO:-"entelecheia/entelecheia"} # The GitHub repository name of the project
APP_SOURCE_BRANCH=${APP_SOURCE_BRANCH:-"main"} # The branch of the project to clone
APP_INSTALL_ROOT=${APP_INSTALL_ROOT:-"/workspace/projects"} # The directory in the container where the project will be installed or cloned
APP_CLONE_DIRNAME=${APP_CLONE_DIRNAME:-"entelecheia/entelecheia"} # The directory name for the cloned project
APP_SERVER_NAME=${APP_SERVER_NAME:-"app"} # The server name (optional, can be left empty)
APP_CUDA_DEVICE_ID=${APP_CUDA_DEVICE_ID:-"all"} # The ID of the CUDA device to use, e.g. all, 0, 1, 2, etc.
APP_HOST_SSH_PORT=${APP_HOST_SSH_PORT:-"2222"} # The SSH port on the host machine to be mapped to the container's SSH port
APP_HOST_JUPYTER_PORT=${APP_HOST_JUPYTER_PORT:-"18888"} # The Jupyter port on the host machine to be mapped to the container's Jupyter port
APP_JUPYTER_TOKEN=${APP_JUPYTER_TOKEN:-"__juypter_token_(change_me)__"} # The Jupyter token to use
APP_HOST_WEB_SVC_PORT=${APP_HOST_WEB_SVC_PORT-"18080"} # The Web service port on the host machine to be mapped to the container's Web service port
GIT_COMMIT_GPGSIGN=${GIT_COMMIT_GPGSIGN:-"false"} # Whether to GPG-sign Git commits

#######################################################################################
# Host machine environment variables #
#######################################################################################
SYSTEM_HOSTNAME=${SYSTEM_HOSTNAME:-"$(hostname)"} # The hostname of the System. If not set, the system's hostname will be used.
USERNAME=${USERNAME:-"$(whoami)"} # The username of the user. If not set, the current user's username will be used.
WORKSPACE_ROOT=${WORKSPACE_ROOT:-"/home/${USERNAME}/workspace"} # The workspace directory on the host machine

#######################################################################################
# Please do not make any changes below this line if you don't know what you are doing #
# change the variables above to your need #
#######################################################################################
# docker build: Configuration parameters for building the Docker image
CONTAINTER_REGISTRY="ghcr.io" # The Docker registry to push the image to.
DOCKER_NAME=${APP_NAME:-"hyperfast-docker"} # The base name of the Docker image.
VARIANT=${APP_VARIANT:-"app"} # The variant of the Docker image.
DOCKER_USERNAME=${DOCKER_USERNAME:-"entelecheia"} # The username for Docker.
USER_UID=${USER_UID:-"9001"} # The user ID in the Docker container.
USER_GID=${USER_GID:-"9001"} # The group ID in the Docker container.
CONTAINER_WORKSPACE_LOCATION="/" # The location of the workspace directory in the Docker container
CONTAINER_WORKSPACE_ROOT="/workspace" # The workspace directory in the Docker container
DOCKER_NAME=${APP_NAME:-"hyperfast-docker"} # The base name of the Docker image.
VARIANT=${APP_VARIANT:-"app"} # The variant of the Docker image.
DOCKER_USERNAME=${DOCKER_USERNAME:-"entelecheia"} # The username for Docker.
USERNAME=${USERNAME:-"app"} # The username of the user. If not set, the current user's username will be used.
USER_UID=${USER_UID:-"9001"} # The user ID in the Docker container.
USER_GID=${USER_GID:-"9001"} # The group ID in the Docker container.
CONTAINER_WORKSPACE_LOCATION=${CONTAINER_WORKSPACE_LOCATION:-"/"} # The location of the workspace directory in the Docker container
CONTAINER_WORKSPACE_ROOT=${CONTAINER_WORKSPACE_ROOT:-"/workspace"} # The workspace directory in the Docker container

CONTAINTER_REGISTRY=${CONTAINTER_REGISTRY:-"ghcr.io"} # The Docker registry to push the image to.
APP_VERSION=${APP_VERSION:-"1.0.0"} # The version of the Docker image. If not set, "1.0.0" will be used.
IMAGE_TAG="${APP_VERSION}-${VARIANT}" # The tag of the Docker image
IMAGE_NAME="${DOCKER_USERNAME}/${DOCKER_NAME}" # The full name of the Docker image
BASE_VARIANT=${BASE_VARIANT:-"base"} # The variant of the Docker image.
IMAGE_NAME="${CONTAINTER_REGISTRY}/${DOCKER_USERNAME}/${DOCKER_NAME}" # The full name of the Docker image
BASE_VARIANT=${BASE_VARIANT:-"base"} # The variant of the Docker image.
BUILD_FROM="${CONTAINTER_REGISTRY}/${IMAGE_NAME}:latest-${BASE_VARIANT}" # The base image for the Docker build

# docker run: Configuration parameters for running the Docker container
CONTAINER_HOSTNAME="${DOCKER_NAME}-${SYSTEM_HOSTNAME}" # The hostname of the Docker container
DOCKER_NETWORK_NAME="${DOCKER_NAME}-network" # The name of the Docker network
CONTAINER_IPC="host" # The IPC mode for the Docker container
CONTAINER_IPC=${CONTAINER_IPC:-"host"} # The IPC mode for the Docker container
CUDA_DEVICE_ID=${APP_CUDA_DEVICE_ID} # The ID of the CUDA device to use.
SSH_PORT="22" # The SSH port in the Docker container
SSH_PORT=${SSH_PORT:-"22"} # The SSH port in the Docker container
HOST_SSH_PORT=${APP_HOST_SSH_PORT} # The SSH port on the host machine to be mapped to the container's SSH port.
WEB_SVC_PORT="8000" # The Web service port in the Docker container
WEB_SVC_PORT=${WEB_SVC_PORT:-"8080"} # The Web service port in the Docker container
HOST_WEB_SVC_PORT=${APP_HOST_WEB_SVC_PORT} # The Web service port on the host machine to be mapped to the container's Web service port.

JUPYTER_PORT="8585" # The Jupyter port in the Docker container
HOST_JUPYTER_PORT=${APP_HOST_JUPYTER_PORT} # The Jupyter port on the host machine to be mapped to the container's Jupyter port. If not set, port 18585 will be used.
JUPYTER_TOKEN=${APP_JUPYTER_TOKEN} # The Jupyter token to use. If not set, a random token will be generated.
JUPYTER_PORT=${JUPYTER_PORT:-"8585"} # The Jupyter port in the Docker container
HOST_JUPYTER_PORT=${APP_HOST_JUPYTER_PORT} # The Jupyter port on the host machine to be mapped to the container's Jupyter port. If not set, port 18585 will be used.
JUPYTER_TOKEN=${APP_JUPYTER_TOKEN} # The Jupyter token to use. If not set, a random token will be generated.

LAUNCH_SCRIPT="${CONTAINER_WORKSPACE_ROOT}/scripts/launch.sh" # The name of the launch script
30 changes: 15 additions & 15 deletions .docker/docker.base.env
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,30 @@
# Host machine environment variables #
#######################################################################################
SYSTEM_HOSTNAME=${SYSTEM_HOSTNAME:-"$(hostname)"} # The hostname of the System. If not set, the system's hostname will be used.
USERNAME=${USERNAME:-"$(whoami)"} # The username of the user. If not set, the current user's username will be used.
WORKSPACE_ROOT=${WORKSPACE_ROOT:-"/home/${USERNAME}/workspace"} # The workspace directory on the host machine

#######################################################################################
# Please do not make any changes below this line if you don't know what you are doing #
# change the variables above to your need #
#######################################################################################
# docker build: Configuration parameters for building the Docker image
CONTAINTER_REGISTRY="ghcr.io" # The Docker registry to push the image to.
DOCKER_NAME="hyperfast-docker" # The base name of the Docker image.
BASE_VARIANT="base" # The variant of the Docker image.
USERNAME="app" # The username in the Docker container.
DOCKER_USERNAME="entelecheia" # The username for Docker.
USER_UID="9001" # The user ID in the Docker container.
USER_GID="9001" # The group ID in the Docker container.
CONTAINER_WORKSPACE_ROOT="/workspace" # The workspace directory in the Docker container
DOCKER_NAME="hyperfast-docker" # The base name of the Docker image.
BASE_VARIANT=${BASE_VARIANT:-"base"} # The variant of the Docker image.
DOCKER_USERNAME=${DOCKER_USERNAME:-"entelecheia"} # The username for Docker.
USERNAME=${USERNAME:-"app"} # The username of the user. If not set, the current user's username will be used.
USER_UID=${USER_UID:-"9001"} # The user ID in the Docker container.
USER_GID=${USER_GID:-"9001"} # The group ID in the Docker container.
CONTAINER_WORKSPACE_LOCATION=${CONTAINER_WORKSPACE_LOCATION:-"/"} # The location of the workspace directory in the Docker container
CONTAINER_WORKSPACE_ROOT=${CONTAINER_WORKSPACE_ROOT:-"/workspace"} # The workspace directory in the Docker container

APP_VERSION=${APP_VERSION:-"1.0.0"} # The version of the Docker image. If not set, "1.0.0" will be used.
IMAGE_TAG="${APP_VERSION}-${BASE_VARIANT}" # The tag of the Docker image
IMAGE_NAME="${DOCKER_USERNAME}/${DOCKER_NAME}" # The full name of the Docker image
BUILD_FROM="python:3.9-slim-bookworm" # The base image for the Docker build
CONTAINTER_REGISTRY=${CONTAINTER_REGISTRY:-"ghcr.io"} # The Docker registry to push the image to.
APP_VERSION=${APP_VERSION:-"1.0.0"} # The version of the Docker image. If not set, "1.0.0" will be used.
IMAGE_TAG="${APP_VERSION}-${BASE_VARIANT}" # The tag of the Docker image
IMAGE_NAME="${CONTAINTER_REGISTRY}/${DOCKER_USERNAME}/${DOCKER_NAME}" # The full name of the Docker image
BUILD_FROM="python:3.9-slim-bookworm" # The base image for the Docker build

# docker run: Configuration parameters for running the Docker container
CONTAINER_HOSTNAME="${DOCKER_NAME}-${SYSTEM_HOSTNAME}" # The hostname of the Docker container
DOCKER_NETWORK_NAME="${DOCKER_NAME}-network" # The name of the Docker network
CONTAINER_IPC="host" # The IPC mode for the Docker container
RUN_COMMAND="/bin/zsh" # The command to run in the Docker container
CONTAINER_IPC=${CONTAINER_IPC:-"host"} # The IPC mode for the Docker container
RUN_COMMAND="bash" # The command to run in the Docker container

0 comments on commit 1f35d2b

Please sign in to comment.