Skip to content

Commit fd23fff

Browse files
committed
run command to add user on container startup
1 parent 63ea485 commit fd23fff

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ RUN mkdir -p /app/client/public/images /app/api/logs
2929
# Node API setup
3030
EXPOSE 3080
3131
ENV HOST=0.0.0.0
32-
CMD ["npm", "run", "backend"]
32+
CMD ["/bin/sh", "start.sh"]
3333

3434
# Optional: for client with nginx routing
3535
# FROM nginx:stable-alpine AS nginx-client

start.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/sh
2+
3+
func_term() {
4+
echo "Caught SIGTERM signal!"
5+
kill -TERM "$child" 2>/dev/null
6+
}
7+
trap func_term SIGTERM
8+
9+
npm run backend &
10+
11+
npm run create-user [email protected] Cosmo Cosmo W3LoveCosmo -- --email-verified=y
12+
13+
child=$!
14+
wait "$child"

0 commit comments

Comments
 (0)