Commit acd49a24 authored by Dominique Feyer's avatar Dominique Feyer
Browse files

TASK: Exec init script only on production

parent 022c435d
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -29,6 +29,8 @@ fi
exit 0
```

Custom start script run only when the `FLOWAPP_CONTEXT` is `Production`.

## Flow Framework support

When you start your container, the following commands are run automatically:
@@ -43,7 +45,9 @@ This feature use the "Custom start scripts" and the file is located at `/docker-
## Security

Introducing `fixuid`, before version 1.0 everything in the container run as root. Now we
define a default user `docker` (UID: 1000, GID: 1000). You can change the UID/GID to match your local user. Check the [documentation](https://github.com/boxboat/fixuid/) for the required arguments. To enable `fixuid` you must set the env variable `FLOWAPP_CONTEXT` to `Development`.
define a default user `docker` (UID: 1000, GID: 1000). You can change the UID/GID to match your local user. Check the [documentation](https://github.com/boxboat/fixuid/) for the required arguments. 

To enable `fixuid` you must set the env variable `FLOWAPP_CONTEXT` to `Development`.

**Warning**: You MUST never use `fixuid` in production.

+5 −4
Original line number Diff line number Diff line
@@ -2,6 +2,11 @@

FLOWAPP_CONTEXT="${FLOWAPP_CONTEXT:-Development}"

if [ $FLOWAPP_CONTEXT == 'Development' ]; then
  fixuid "$@"
else
  echo "fixuid: skipped because FLOWAPP_CONTEXT is not Development"

  DIR=/docker-entrypoint.d

  if [ -d "$DIR" ]; then
@@ -14,9 +19,5 @@ if [ -d "$DIR" ]; then
    done
  fi

if [ $FLOWAPP_CONTEXT == 'Development' ]; then
  fixuid "$@"
else
  echo "fixuid: skipped because FLOWAPP_CONTEXT is not Development"
  exec "$@"
fi