Skip to content

Commit

Permalink
chore: set bento_user and git in dev image
Browse files Browse the repository at this point in the history
  • Loading branch information
v-rocheleau committed Aug 30, 2023
1 parent f55926e commit 299e20e
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/api/dev.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,8 @@ RUN go mod download && go mod vendor

# Repository mounted to the container
WORKDIR /gohan-api/src/api
COPY entrypoint.bash .
COPY run.dev.bash .

CMD [ "air" ]
ENTRYPOINT [ "bash", "./entrypoint.bash" ]
CMD [ "bash", "./run.dev.bash" ]
17 changes: 17 additions & 0 deletions src/api/entrypoint.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

cd /gohan-api || exit

# Create bento_user and home
source /create_service_user.bash

# Create dev build directory
mkdir -p src/api/tmp

# Set permissions / groups
chown -R bento_user:bento_user ./
chown -R bento_user:bento_user /app
chmod -R o-rwx src/api/tmp

# Drop into bento_user from root and execute the CMD specified for the image
exec gosu bento_user "$@"
7 changes: 7 additions & 0 deletions src/api/run.dev.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

# Set .gitconfig for development
/set_gitconfig.bash

# Start gohan-api with hot reload using Air
air

0 comments on commit 299e20e

Please sign in to comment.