Skip to content

Commit

Permalink
add missing stuff in docker-entrypoint
Browse files Browse the repository at this point in the history
  • Loading branch information
myrho committed Jan 19, 2024
1 parent 5aa0022 commit 289efda
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ RUN npm install

COPY ./docker/docker-entrypoint.sh /
RUN chmod +x /docker-entrypoint.sh

ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["nginx", "-g", "pid /tmp/nginx.pid;daemon off;"]
EXPOSE 8000
18 changes: 9 additions & 9 deletions docker/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#!/bin/ash
set -e

echo $DOCKER_UID
echo $DOCKER_USER
addgroup $DOCKER_USER
adduser $DOCKER_USER -G $DOCKER_USER -u $DOCKER_UID -D
for plugin in `find ./plugins -mindepth 1 -maxdepth 1 -type d`; do
cd $WORKDIR/$plugin
npm install
cd -
done

chown -R $DOCKER_USER $WORKDIR
chown -R $DOCKER_USER /usr/share/nginx/html
chown -R $DOCKER_USER /var/lib/nginx
chown -R $DOCKER_USER /var/log/nginx
npm run build && cp -r $WORKDIR/dist/* /usr/share/nginx/html/

su $DOCKER_USER
chown -R $DOCKER_UID /usr/share/nginx/html/*

sed -i "s|http://localhost:9000|$REST_URL|g" /usr/share/nginx/html/assets/index.*.js

exec "$@"

0 comments on commit 289efda

Please sign in to comment.