|
9 | 9 | # ...and adjust services below as needed. The examples shown below are not |
10 | 10 | # exhaustive. |
11 | 11 | # |
| 12 | +# Some sections of this file facilitate alignment of users and groups when |
| 13 | +# mounting code as container volumes. These values first read from the UID |
| 14 | +# and GID environment variables if available and fall back to "501" as the |
| 15 | +# sensible default for MacOS contributors (the folks that will most likely |
| 16 | +# need to override user/group here). Linux users typically have a UID=1000 |
| 17 | +# and GID=1000. Since these are image defaults, we do not need to override |
| 18 | +# these unless we're using a system where our account doesn't have UID/GID |
| 19 | +# of 1000. |
| 20 | +# |
| 21 | +# To assign the UID and GID environment variables automatically, run: |
| 22 | +# |
| 23 | +# export UID=$(id -u) GID=$(id -g) |
| 24 | +# |
| 25 | +# Add the above command to a profile script to avoid the need to run it in |
| 26 | +# every session. Some shells set these variables in the scope of the shell |
| 27 | +# process (not the environment). We still need to export the values to the |
| 28 | +# environment to access those here. For example, Bash sets UID, and we can |
| 29 | +# export it directly: |
| 30 | +# |
| 31 | +# export UID GID=$(id -g) |
| 32 | +# |
| 33 | +# Alternatively, add the UID and GID variables to your .env file. |
| 34 | +# |
12 | 35 |
|
13 | 36 | name: tdei-workspaces |
14 | 37 |
|
| 38 | +x-node-dev-base: |
| 39 | + &node-dev-base |
| 40 | + # Build the container so that the runtime user matches the local user. |
| 41 | + build: |
| 42 | + args: |
| 43 | + APP_UID: ${UID:-501} |
| 44 | + APP_GID: ${GID:-501} |
| 45 | + # Run the container as your local user so that file permissions match. |
| 46 | + user: "${UID:-501}:${GID:-501}" |
| 47 | + |
15 | 48 | services: |
16 | 49 | frontend: |
17 | | - # Run the container as your local user so that file permissions match. |
18 | | - # |
19 | | - # The default UID for MacOS is typically 501. For Linux, this is typically |
20 | | - # 1000. Run `id -u` to confirm. |
21 | | - # |
22 | | - user: 501 |
| 50 | + <<: *node-dev-base |
| 51 | + |
| 52 | + rapid: |
| 53 | + <<: *node-dev-base |
| 54 | + |
| 55 | + pathways-editor: |
| 56 | + <<: *node-dev-base |
23 | 57 |
|
24 | 58 | tasks-backend: |
25 | | - # Build the container as your local user so that file permissions match. |
26 | | - # |
27 | | - # The default UID for MacOS is typically 501. For Linux, this is typically |
28 | | - # 1000. Run `id -u` to confirm. |
29 | | - # |
| 59 | + # Build the container as your local user so that permissions match. |
30 | 60 | build: |
31 | 61 | args: |
32 | | - APP_UID: 501 |
| 62 | + APP_UID: ${UID:-501} |
0 commit comments