mirror of
https://github.com/ajnart/homarr.git
synced 2025-10-30 18:15:56 +01:00
🐛 Issue with migrate script in docker (#1483)
This commit is contained in:
@@ -25,10 +25,11 @@ COPY ./src/migrate.ts ./src/migrate.ts
|
|||||||
RUN apt-get update -y && apt-get install -y openssl
|
RUN apt-get update -y && apt-get install -y openssl
|
||||||
|
|
||||||
# Required for migration
|
# Required for migration
|
||||||
RUN cp -r node_modules node_modules_cache
|
RUN mv node_modules _node_modules
|
||||||
RUN rm -rf node_modules
|
|
||||||
RUN rm package.json
|
RUN rm package.json
|
||||||
RUN yarn add typescript ts-node dotenv drizzle-orm@0.28.6 better-sqlite3@8.6.0 @types/better-sqlite3
|
RUN yarn add typescript ts-node dotenv drizzle-orm@0.28.6 better-sqlite3@8.6.0 @types/better-sqlite3
|
||||||
|
RUN mv node_modules node_modules_migrate
|
||||||
|
RUN mv _node_modules node_modules
|
||||||
|
|
||||||
# Expose the default application port
|
# Expose the default application port
|
||||||
EXPOSE $PORT
|
EXPOSE $PORT
|
||||||
|
|||||||
@@ -2,7 +2,8 @@
|
|||||||
|
|
||||||
echo "Exporting hostname..."
|
echo "Exporting hostname..."
|
||||||
export NEXTAUTH_URL_INTERNAL="http://$HOSTNAME:7575"
|
export NEXTAUTH_URL_INTERNAL="http://$HOSTNAME:7575"
|
||||||
|
mv node_modules _node_modules
|
||||||
|
mv node_modules_migrate node_modules
|
||||||
echo "Migrating database..."
|
echo "Migrating database..."
|
||||||
yarn ts-node src/migrate.ts & PID=$!
|
yarn ts-node src/migrate.ts & PID=$!
|
||||||
# Wait for migration to finish
|
# Wait for migration to finish
|
||||||
@@ -10,11 +11,11 @@ wait $PID
|
|||||||
|
|
||||||
echo "Reverting to production node_modules..."
|
echo "Reverting to production node_modules..."
|
||||||
# Copy specific sqlite3 binary to node_modules
|
# Copy specific sqlite3 binary to node_modules
|
||||||
cp /app/node_modules/better-sqlite3/build/Release/better_sqlite3.node /app/node_modules_cache/better-sqlite3/build/Release/better_sqlite3.node
|
cp /app/node_modules/better-sqlite3/build/Release/better_sqlite3.node /app/_node_modules/better-sqlite3/build/Release/better_sqlite3.node
|
||||||
|
|
||||||
# Remove node_modules and copy cached node_modules
|
# Remove node_modules and copy cached node_modules
|
||||||
rm -r /app/node_modules
|
mv node_modules node_modules_migrate
|
||||||
cp -r /app/node_modules_cache /app/node_modules
|
mv _node_modules node_modules
|
||||||
cp ./temp_package.json package.json
|
cp ./temp_package.json package.json
|
||||||
cp ./temp_yarn.lock yarn.lock
|
cp ./temp_yarn.lock yarn.lock
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user