-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathentrypoint.bash
33 lines (26 loc) · 1.01 KB
/
entrypoint.bash
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
#!/bin/bash
cd /drs || exit
# Create bento_user + home
source /create_service_user.bash
# Fix permissions on /drs; fix data directory permissions more specifically if needed
chown -R bento_user:bento_user /drs
if [[ -n "${BENTO_DRS_CONTAINER_DATA_VOLUME_DIR}" ]]; then
# Location of volume mount - run chown here.
chown -R bento_user:bento_user "${BENTO_DRS_CONTAINER_DATA_VOLUME_DIR}"
fi
# Use the database and object folder path variables more directly to create them
# and set their permissions.
if [[ -n "${DATABASE}" ]]; then
# DATABASE is a folder; confusing naming
mkdir -p "${DATABASE}"
chown -R bento_user:bento_user "${DATABASE}"
fi
if [[ -n "${DATA}" ]]; then
# DATA is another folder; confusing naming
mkdir -p "${DATA}"
chown -R bento_user:bento_user "${DATA}"
fi
# Set .gitconfig for development, since we're overriding the base image entrypoint
gosu bento_user /bin/bash -c '/set_gitconfig.bash'
# Drop into bento_user from root and execute the CMD specified for the image
exec gosu bento_user "$@"