-
Notifications
You must be signed in to change notification settings - Fork 5
/
copier.yaml
269 lines (220 loc) · 7.1 KB
/
copier.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
_subdirectory: .copier-template
# Configure jinja2 defaults to make syntax highlighters lives easier
_templates_suffix: .jinja
_envops:
block_end_string: "%}"
block_start_string: "{%"
comment_end_string: "#}"
comment_start_string: "{#"
keep_trailing_newline: true
variable_end_string: "}}`"
variable_start_string: "`{{"
_answers_file: .copier-docker-config.yaml
_tasks:
# Strings get executed under system's default shell
- "[ -d .git ] || git init"
- "{% if github_repo_name %}git add remote origin https://github.com/`{{ github_username }}`/`{{ github_repo_name }}`.git 2>/dev/null || echo 'origin already exists'{% else %}echo 'No GitHub repository name provided. Skipping git remote add.'{% endif %}"
# questions
docker_project_name:
type: str
help: What is your docker project name? (it will be used as docker image name)
validator: >-
{% if not (docker_project_name | regex_search('^[a-z][a-z0-9\-]+$')) %}
docker_project_name must start with a letter, followed one or more letters, digits or dashes in lowercase only
{% endif %}
docker_name_prefix:
default: "`{{ docker_project_name | replace('-', '_') | upper }}`"
type: str
help: What is your docker name prefix? (it will be used as prefix for environment variables)
validator: >-
{% if not (docker_name_prefix | regex_search('^[A-Z][A-Z0-9_]+$')) %}
docker_name_prefix must start with a letter, followed one or more letters, digits or underscores in uppercase only
{% endif %}
friendly_name:
default: "`{{ docker_project_name }}`"
type: str
help: What is your project friendly name? (it will be used for the title of the documentation)
project_short_description:
type: str
help: What is your project short description?
project_description:
type: str
help: What is your project description?
project_license:
type: str
choices:
- MIT
- CC-BY-4.0
- Apache-2.0
- GPLv3
- None
author:
type: str
help: What is your name?
validator: >-
{% if not (author | regex_search('^[a-zA-Z][a-zA-Z ]+$')) %}
author must start with a letter, followed one or more letters or spaces
{% endif %}
github_username:
type: str
help: What is your GitHub username?
validator: >-
{% if not (github_username | regex_search('^[a-z0-9][a-z0-9\-]+$')) %}
github_username must start with a letter or digit, followed one or more letters, digits or dashes in lowercase only
{% endif %}
email:
default: "`{{ github_username }}`@"
type: str
help: What is your email?
validator: >-
{% if not (email | regex_search('^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$')) %}
email must be a valid email address
{% endif %}
github_repo_name:
default: "`{{ docker_project_name }}`"
type: str
help: What is your GitHub repository name?
main_branch:
default: main
type: str
help: What is your main branch name?
docker_registry:
default: ghcr.io
type: str
help: What is your Docker registry? (e.g. ghcr.io)
docker_username:
default: "`{{ github_username }}`"
type: str
help: What is your Docker username? (if you use ghcr.io, it should be the same as your GitHub username)
build_images_from_dockerfile:
default: true
type: bool
help: Do you want to build images from Dockerfile?
use_deploy_workflows:
default: true
type: bool
help: Do you want to use GitHub Actions deploy workflows? (certain images are not supported by GitHub Actions.)
docker_image_version_variable_name:
default: IMAGE_VERSION
type: str
help: What is your docker image version variable name? (it will be used in Dockerfiles and workflows)
use_semantic_versioning_for_image:
default: true
type: bool
help: Do you want to use semantic release versioning for your docker image tags?
docker_service_name:
default: workspace
type: str
help: What is your container service name? (e.g. workspace)
docker_image_variant_name:
default: base
type: str
help: What is the name of your Docker image variant?
docker_build_from:
default: library/ubuntu:22.04
type: str
help: What is your Docker image build from?
docker_timezone:
default: Asia/Seoul
type: str
help: What is your Docker time zone?
docker_apt_packages:
default: "fontconfig fonts-nanum"
type: str
help: What is your additional apt packages to install? (separated by space, "curl wget jq sudo tzdata locales locales-all python3-launchpadlib software-properties-common" by default)
docker_container_username:
default: "app"
type: str
help: What is the username of the docker container? (non-root user)
docker_container_uid:
default: 9001
type: int
help: What is the uid of the docker container user?
container_workspace_root:
default: /workspace
type: str
help: What is the workspace root in the docker container?
app_install_root:
default: "/opt"
type: str
help: "What is your application install root? (default: opt)"
app_dirname:
default: "`{{ docker_project_name }}`"
type: str
help: "What is your application directory name to clone? (default: `{{ app_source_repo | regex_replace('.*/', '') }}`)"
copy_scripts_dir:
default: true
type: bool
help: "Do you want to copy scripts directory under the workspace root? ? (COPY ./.docker/scripts/ ./scripts/)"
install_dotfiles:
default: false
type: bool
help: Do you want to install dotfiles?
docker_run_command:
default: bash
type: str
help: "What is your command to run when the docker image is run? (default: bash)"
container_service_name:
default: app
type: str
help: What is your app server name?
launch_scripts:
default: launch.sh
type: str
help: What is your launch script to run when the docker image is run? (put it in the docker scripts directory)
enable_nvidia_gpu:
default: true
type: bool
help: Do you want to enable NVIDIA GPU?
cuda_device_id:
default: all
type: str
help: "What is your CUDA device to use? (default: all)"
use_tty:
default: false
type: bool
help: Do you want to enable tty (pseudo-terminal) when running the Docker container?
restart_always:
default: false
type: bool
help: Do you want to set restart policy to 'always' for the Docker container?
use_ssh_service:
default: true
type: bool
help: Do you want to use SSH?
ssh_port:
default: 22
type: int
help: "What is your SSH container port to expose? (default: 22)"
ssh_host_port:
default: 2222
type: int
help: "What is your SSH host port to expose? (default: 2222)"
use_jupyter:
default: true
type: bool
help: Do you want to use Jupyter?
jupyter_port:
default: 8585
type: int
help: "What is your Jupyter container port to expose? (default: 8888)"
jupyter_host_port:
default: 18888
type: int
help: "What is your Jupyter host port to expose? (default: 18888)"
jupyter_token:
default: "__juypter_token_(change_me)__"
type: str
help: "What is your Jupyter token? (default: empty)"
use_web_service:
default: true
type: bool
help: Do you want to use web service?
web_service_port:
default: 8080
type: int
help: "What is your web service container port to expose? (default: 8080)"
web_service_host_port:
default: 18080
type: int
help: "What is your web service host port to expose? (default: 18080)"