diff --git a/Dockerfile b/Dockerfile index 29c9f82b..2a40cbfb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -31,6 +31,8 @@ ADD resources /app/resources COPY --from=build /build/dist . COPY --from=build /build/package.json /build/pnpm-lock.yaml ./ +COPY --from=build /build/migrations ./migrations +COPY --from=build /build/knexfile.js ./knexfile.js RUN corepack enable && corepack prepare pnpm@$PNPM_VERSION --activate && pnpm install --prod --frozen-lockfile --silent diff --git a/deploy/docker-compose.prod.yml b/deploy/docker-compose.prod.yml index 0f70c56b..1631c188 100644 --- a/deploy/docker-compose.prod.yml +++ b/deploy/docker-compose.prod.yml @@ -71,18 +71,17 @@ services: retries: 10 nostream-migrate: - image: nostream-migrate:local + image: ghcr.io/cameri/nostream:main pull_policy: never container_name: nostream-migrate + user: node:node + command: ['node_modules/.bin/knex', 'migrate:latest'] environment: DB_HOST: nostream-db DB_PORT: 5432 DB_USER: ${DB_USER} DB_PASSWORD: ${DB_PASSWORD} DB_NAME: ${DB_NAME} - volumes: - - ./migrations:/code/migrations - - ./knexfile.js:/code/knexfile.js depends_on: nostream-db: condition: service_healthy