From ed5f8a93ddcd256c461a9abd18a80ecda301571a Mon Sep 17 00:00:00 2001 From: Faizan Ahmed <43652410+faizancodes@users.noreply.github.com> Date: Tue, 18 Mar 2025 19:05:30 -0400 Subject: [PATCH] fix: docker setup (#125) --- Dockerfile | 10 ++-------- docker-entrypoint.sh | 3 +++ 2 files changed, 5 insertions(+), 8 deletions(-) create mode 100755 docker-entrypoint.sh diff --git a/Dockerfile b/Dockerfile index 47a8c58092..fdbc629408 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,11 +14,5 @@ RUN npx drizzle-kit generate EXPOSE 3000 -# Create a startup script that will run migrations and then start the app -RUN echo '#!/bin/sh\nnpx drizzle-kit push\nexec "$@"' > /app/docker-entrypoint.sh && \ - chmod +x /app/docker-entrypoint.sh - -ENTRYPOINT ["/app/docker-entrypoint.sh"] - -# Default to development mode -CMD ["npm", "run", "dev"] \ No newline at end of file +# Run migrations and start the app +CMD npx drizzle-kit push && npm run dev \ No newline at end of file diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh new file mode 100755 index 0000000000..a52442e8cb --- /dev/null +++ b/docker-entrypoint.sh @@ -0,0 +1,3 @@ +#!/bin/sh +npx drizzle-kit push +exec "$@" \ No newline at end of file