mirror of
https://github.com/LogicLabs-OU/OpenArchiver.git
synced 2026-04-06 00:31:57 +02:00
* define base image arg * create base stage with common content * chmod executable entrypoint file this avoids re-copying the same file as is being modified in the docker layer * cache npm downloaded packages avoids re-downloading deps if cache content is available
18 lines
601 B
Bash
Executable File
18 lines
601 B
Bash
Executable File
#!/bin/sh
|
|
|
|
# Exit immediately if a command exits with a non-zero status
|
|
set -e
|
|
|
|
# Run pnpm install to ensure all dependencies, including native addons,
|
|
# are built for the container's architecture. This is crucial for
|
|
# multi-platform Docker images, as it prevents "exec format error"
|
|
# when running on a different architecture than the one used for building.
|
|
pnpm install --frozen-lockfile --prod
|
|
|
|
# Run database migrations before starting the application to prevent
|
|
# race conditions where the app starts before the database is ready.
|
|
pnpm db:migrate
|
|
|
|
# Execute the main container command
|
|
exec "$@"
|