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
Copy file name to clipboardExpand all lines: .kube/app/Dockerfile
+18-8
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,9 @@ ENV APP_DIR /app
9
9
ENV KUBE_DIR .kube/app
10
10
11
11
ARG CIPHERSWEET_KEY
12
+
ARG USER_ID
13
+
# If argument passed then swap out numerical id for www-data user to allow for mirroring volumes from local to host set via .env file variable WWWUSER and is auto-generate when starting nix-shell for the first time
14
+
RUN [ -z "$USER_ID" ] || usermod -u $USER_ID www-data
12
15
13
16
RUN apt-get update
14
17
@@ -49,7 +52,8 @@ RUN apt-get install -y \
49
52
50
53
RUN mkdir -p /tmp/imagick
51
54
WORKDIR /tmp/imagick
52
-
RUN curl -L -o /tmp/imagick.tar.gz https://github.com/Imagick/imagick/archive/refs/tags/3.7.0.tar.gz # upgrade version when bumping PHP version
55
+
# upgrade version when bumping PHP version
56
+
RUN curl -L -o /tmp/imagick.tar.gz https://github.com/Imagick/imagick/archive/refs/tags/3.7.0.tar.gz
53
57
RUN tar --strip-components=1 -xf /tmp/imagick.tar.gz
## sync files from container storage to permanent storage then remove container storage
14
-
rsync -a /app/storage/ $FILES_PATH
11
+
rsync -a --chown=www-data:www-data /app/storage/ $FILES_PATH
15
12
rm -rf /app/storage
16
13
17
-
## sync files from container cache to permanent storage then remove container cache
18
-
## removed syncing to shared/permenant storage https://github.com/accessibility-exchange/platform/issues/1596
19
-
# rsync -a /app/bootstrap/cache/ $CACHE_PATH
20
-
# rm -rf /app/bootstrap/cache
21
-
22
14
## create symlinks from permanent storage & cache to application directory folders
23
15
ln -s $FILES_PATH /app/storage
24
-
## removed linked to shared/permenant storage https://github.com/accessibility-exchange/platform/issues/1596
25
-
# ln -s $CACHE_PATH /app/bootstrap/cache
26
16
27
17
php artisan deploy:local
28
18
29
19
flock -n -E 0 /opt/data -c "php artisan deploy:global"# run exclusively on a single instance at once
30
20
31
-
## fix permissions after syncing to existing storage and cache https://github.com/accessibility-exchange/platform/issues/1236
32
-
chown -R www-data:root /app/bootstrap/cache $FILES_PATH# $CACHE_PATH removed per and added path to cache in the pod https://github.com/accessibility-exchange/platform/issues/1596
33
-
34
21
# Generate the robots.txt and sitemap.xml files
35
22
php artisan seo:generate
36
23
24
+
# Add in symlink to ownership update, add in public folder where assets are compiled
These aliases simplify working with `kubectl` in different namespaces:
210
-
211
-
- `kcd` → Shortcut for `kubectl -n iris-accessibility-development`
212
-
- `kcs` → Shortcut for `kubectl -n iris-accessibility-staging`
213
-
- `kcp` → Shortcut for `kubectl -n iris-accessibility-production`
214
-
215
-
#### Pod Flushing Functions
216
-
217
-
##### `kflush` Function
218
-
The `kflush` function executes Laravel deployment commands (`php artisan deploy:local` and `php artisan deploy:global`) inside running `app-` pods for a given namespace.
219
-
220
-
###### Usage:
221
-
```sh
222
-
kflush <namespace>
223
-
```
224
-
Example:
225
-
```sh
226
-
kflush development
227
-
```
228
-
This will:
229
-
1. Find all running pods with the `app-` prefix in the `iris-accessibility-<namespace>` namespace.
230
-
2. Execute `php artisan deploy:local` in each pod.
231
-
3. Execute `php artisan deploy:global` in the first matching pod.
232
-
233
-
##### `kflushall` Function
234
-
Flushes all `app-` pods in all environments (`development`, `staging`, `production`).
235
-
236
-
###### Usage:
237
-
```sh
238
-
kflushall
239
-
```
240
-
This iterates through all environments and runs `kflush` for each.
241
-
242
-
##### Namespace-Specific Flush Aliases
243
-
For convenience, predefined aliases allow flushing without specifying the namespace:
244
-
245
-
- `kdflush` → Runs `kflush development`
246
-
- `ksflush` → Runs `kflush staging`
247
-
- `kpflush` → Runs `kflush production`
197
+
#### Entering Development Environment
198
+
199
+
Each time you want to have your terminal environment setup you will want to run `nix-shell` to make sure you have your aliases and packages setup.
200
+
201
+
#### Aliases
202
+
203
+
> :heavy_check_mark: All commands assume they're run from the project root directory where `docker-compose.yml` exists and the user has entered the nix shell by first running `nix-shell`.
0 commit comments