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
Build and run the application using Docker Compose:
202
+
203
+
```bash
204
+
docker compose run --rm -ti --build app
205
+
```
206
+
207
+
This command:
208
+
209
+
- Builds the Docker image with your specified settings.
210
+
- Runs the container interactively.
211
+
212
+
#### Alias Suggestions
213
+
214
+
To simplify commands, create aliases:
215
+
216
+
**For Bash and Zsh:**
217
+
218
+
```bash
219
+
alias wb='docker compose build'
220
+
alias w='docker compose run --rm -ti app'
221
+
```
222
+
223
+
**For Fish Shell:**
224
+
225
+
```bash
226
+
alias wb 'docker compose build'
227
+
alias w 'docker compose run --rm -ti app'
228
+
```
229
+
230
+
Now you can:
231
+
232
+
- Build the container with `wb`.
233
+
- Run the container with `w`.
234
+
235
+
#### Running from Any Directory
236
+
237
+
To run these commands from any directory without specifying the path to `docker-compose.yml`, set the `COMPOSE_FILE` environment variable.
238
+
239
+
**For Bash and Zsh:**
240
+
241
+
```bash
242
+
# Adjust this path to your clone dir
243
+
export COMPOSE_FILE="$(pwd)/docker-compose.yml"
157
244
```
158
245
246
+
**For Fish Shell:**
247
+
248
+
```bash
249
+
# Adjust this path to your clone dir
250
+
set -x COMPOSE_FILE "$(pwd)/docker-compose.yml"
251
+
```
252
+
253
+
This points Docker Compose to your `docker-compose.yml` file, allowing you to use the aliases from any location.
254
+
255
+
#### Using the Application
256
+
257
+
With the aliases and configurations set, you can:
258
+
259
+
- **Build the container:**
260
+
261
+
```bash
262
+
wb
263
+
```
264
+
265
+
- **Run the container:**
266
+
267
+
```bash
268
+
w
269
+
```
270
+
271
+
This starts the container with your specified shell and settings, without needing to provide the shell or directory each time.
272
+
273
+
#### Notes
274
+
275
+
- **Shell and Editor Options:** Common shells include `ash`, `bash`, `fish`, and `zsh`. Editors include `vi`, `nano`, and `vim`.
276
+
- **Timezone Configuration:** Use valid [timezone identifiers](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List) for the `_tz` argument.
277
+
- **Persistent Aliases:** Add the aliases to your shell's configuration file (`~/.bashrc`, `~/.zshrc`, or `~/.config/fish/config.fish`) to make them persistent.
0 commit comments