You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[Webserver & Local Development w/ one](#webserver--local-development-with-a-webserver)
19
19
@@ -151,15 +151,15 @@ Each time you change your pre-run script, you may need to force the docker conta
151
151
152
152
- **Starting from scratch? Want a boilerplate?**
153
153
154
-
If you do not already have scripts or a concept of setup scripts for your stuff yet, then you could use the pre-run example with LEMP-setup-guide.
154
+
If you do not already have scripts or a concept of setup scripts for your stuff yet, then you can use `./docker-script -n <server-name>` along with `scripts/template/template-main` to generate a boilerplate for you to start with.
155
155
156
-
---
156
+
You can make your own templates too! Just copy the template-main and edit them to your liking. The variables defined in this file will be dynamically read and prompted for by the `docker-script` command.
157
157
158
-
If using this approach, then the script-example could be modified to your own setup:
158
+
```
159
+
./docker-script -t <template> -n <server-name>
160
+
```
159
161
160
-
1. In your IDE, open up script-example and copy to a new file - `script-<server-name>`.
161
-
2. Do a search for all matching "variable" placeholders in the file: `<[^>]*>` with regular expression matching
162
-
3. Replace all the variables with your own matching information. Change a lot of things to match your situation!
162
+
This will create a new folder `scripts/script-<your-servername>` with init scripts based on the template-main and other templates scripts we prrovide. You can edit these as needed.
163
163
164
164
---
165
165
@@ -224,16 +224,30 @@ Next, make sure you have put your script into the `scripts` folder with prefix `
224
224
225
225
Each script should log the output to corresponding log file in your scripts folder (or wherever you want really) eg. `script-my_server_dev.log` or `script-log-my_server_dev.log` to avoid the naming completion being too similar to the script itself.
226
226
227
-
Then, ssh into your container, ensure your script is executable, and trigger it:
228
227
229
228
```
230
-
./docker-ssh
229
+
./docker-run -n my_server_dev
230
+
```
231
+
232
+
[↑ Contents](#contents)
233
+
234
+
---
235
+
236
+
## Compiling Scripts
237
+
238
+
When you are done testing your scripts, you can compile both the server scripts with the pre-run into one script to run on your cloud server.
The `-r` flag is optional and means removing emojis from the script. _(linode stack scripts do not like emojis)_.
245
+
The `-p` flag is optional and will default to `pre-run` if not passed.
233
246
234
-
chmod +x script-my_server_dev
247
+
You will still need the entire `server-<server-name>` folder on your server, which will contain the compiled script. On the cloud, you will then run the compiled script.
Copy file name to clipboardExpand all lines: docker-compile
+35-3Lines changed: 35 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -3,16 +3,34 @@
3
3
set -e
4
4
5
5
PRE_RUN='pre-run'
6
-
HELP="ℹ️ How to use:\n\t./docker-compile -n <server-name> -p <pre-run>, where the -p is optional if there's an active pre-run already.\n\teg. ./docker-compile -n mysite.com -p pre-run-mysite.com\n"
7
-
# getopts for -p for pre-run (default:pre-run) and require -n for server name, take a -h for help too
0 commit comments