diff --git a/Dockerfile b/Dockerfile index 1741aaa..35e9a79 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,7 +12,13 @@ RUN npm run build FROM base AS runtime COPY --from=build /app/.output ./.output +COPY --from=build /app/node_modules ./node_modules +COPY --from=build /app/scripts ./scripts +COPY --from=build /app/src/db ./src/db +COPY --from=build /app/src/lib ./src/lib COPY package.json ./ ENV NODE_ENV=production EXPOSE 3000 -CMD ["node", ".output/server/index.mjs"] \ No newline at end of file +COPY entrypoint.sh ./ +RUN chmod +x entrypoint.sh +CMD ["./entrypoint.sh"] \ No newline at end of file diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 0000000..64529c6 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,8 @@ +#!/bin/sh +set -e + +echo "Running database seed..." +npm run db:seed + +echo "Starting server..." +exec node .output/server/index.mjs \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 1f43aaa..1257064 100644 --- a/package-lock.json +++ b/package-lock.json @@ -31,6 +31,7 @@ "tailwind-merge": "^3.0.2", "tailwindcss": "^4.1.18", "three": "^0.185.1", + "tsx": "^4.21.0", "tw-animate-css": "^1.3.6" }, "devDependencies": { @@ -46,7 +47,6 @@ "@vitejs/plugin-react": "^6.0.1", "babel-plugin-react-compiler": "^1.0.0", "dotenv": "^17.3.1", - "tsx": "^4.21.0", "typescript": "^6.0.2", "vite": "^8.0.0" }