Merge pull request 'develop' (#13) from develop into main
All checks were successful
Personal/recall/pipeline/head This commit looks good
All checks were successful
Personal/recall/pipeline/head This commit looks good
Reviewed-on: #13
This commit was merged in pull request #13.
This commit is contained in:
@@ -40,18 +40,24 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|||||||
openssl \
|
openssl \
|
||||||
&& rm -rf /var/lib/apt/lists/* \
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
&& groupadd --system --gid 1001 nodejs \
|
&& groupadd --system --gid 1001 nodejs \
|
||||||
&& useradd --system --uid 1001 nextjs
|
&& useradd --system --uid 1001 nextjs \
|
||||||
|
&& mkdir -p /home/nextjs && chown nextjs:nextjs /home/nextjs
|
||||||
|
|
||||||
COPY --from=builder /app/public ./public
|
COPY --from=builder /app/public ./public
|
||||||
COPY --from=builder /app/.next/standalone ./
|
COPY --from=builder /app/.next/standalone ./
|
||||||
COPY --from=builder /app/.next/static ./.next/static
|
COPY --from=builder /app/.next/static ./.next/static
|
||||||
COPY --from=builder /app/prisma ./prisma
|
COPY --from=builder /app/prisma ./prisma
|
||||||
COPY --from=builder /app/node_modules/.prisma ./node_modules/.prisma
|
COPY --from=builder /app/node_modules/.prisma ./node_modules/.prisma
|
||||||
|
COPY --from=builder /app/node_modules/prisma ./node_modules/prisma
|
||||||
|
COPY --from=builder /app/node_modules/@prisma ./node_modules/@prisma
|
||||||
|
|
||||||
COPY --from=builder /app/prisma/schema.prisma /app/schema.prisma
|
COPY --from=builder /app/prisma/schema.prisma /app/schema.prisma
|
||||||
COPY docker-entrypoint.sh /usr/local/bin/
|
COPY docker-entrypoint.sh /usr/local/bin/
|
||||||
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
|
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
|
||||||
|
|
||||||
|
# Create data directory and initialize database as root
|
||||||
|
RUN mkdir -p /app/data && chown -R nextjs:nodejs /app
|
||||||
|
|
||||||
USER nextjs
|
USER nextjs
|
||||||
|
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
@@ -59,6 +65,7 @@ EXPOSE 3000
|
|||||||
ENV PORT=3000
|
ENV PORT=3000
|
||||||
ENV HOSTNAME="0.0.0.0"
|
ENV HOSTNAME="0.0.0.0"
|
||||||
ENV DATABASE_URL="file:./data/dev.db"
|
ENV DATABASE_URL="file:./data/dev.db"
|
||||||
|
ENV HOME=/home/nextjs
|
||||||
|
|
||||||
ENTRYPOINT ["docker-entrypoint.sh"]
|
ENTRYPOINT ["docker-entrypoint.sh"]
|
||||||
CMD ["node", "server.js"]
|
CMD ["node", "server.js"]
|
||||||
|
|||||||
@@ -4,11 +4,11 @@ set -e
|
|||||||
# Initialize database if it doesn't exist or schema changed
|
# Initialize database if it doesn't exist or schema changed
|
||||||
echo "Checking database..."
|
echo "Checking database..."
|
||||||
|
|
||||||
# Create data directory if it doesn't exist
|
# Create directories with proper permissions
|
||||||
mkdir -p /app/data
|
mkdir -p /app/data
|
||||||
|
|
||||||
# Push schema (safe - won't overwrite data, only syncs schema)
|
# Use local prisma version from node_modules
|
||||||
npx prisma db push --skip-generate --skip-pull
|
./node_modules/prisma/build/index.js db push
|
||||||
|
|
||||||
echo "Starting application..."
|
echo "Starting application..."
|
||||||
exec "$@"
|
exec "$@"
|
||||||
|
|||||||
Reference in New Issue
Block a user