-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Labels
kind/bugSomething isn't workingSomething isn't workingkind/dependenciesPull request that updates a dependency filePull request that updates a dependency filekind/dockerEverything that has to do with dockerEverything that has to do with docker
Description
Describe the bug
Docker container crashes on startup when current Dockerfile is used for the build or the official image, and one selects sqlite as DB backend.
To Reproduce
Steps to reproduce the behavior:
Via Dockerfile
- Clone repository
- Build docker container using docker build
- Change DB backend to sqlite
- Use official traefik installation way to start the container
- Container won't start, the docs will produce the below stacktrace
Via official container
- Use official traefik installation way to start the container
- Change DB backend to sqlite
- Container won't start, the docs will produce the below stacktrace
Expected behavior
Container should start without any problems.
Desktop (please complete the following information):
- OS: Docker version 20.10.21, build baeda1f
- node version: node-14.21.2
- npm version: 6.14.17
- database dialect: sqlite
- commit ref: ae77ac3
Additional context
Traceback
info: loaded config file "/etc/vocascan/vocascan.config.js"
error: unhandledRejection: Please install sqlite3 package manually
Error: Please install sqlite3 package manually
at ConnectionManager._loadDialectModule (/app/node_modules/sequelize/lib/dialects/abstract/connection-manager.js:81:15)
at new ConnectionManager (/app/node_modules/sequelize/lib/dialects/sqlite/connection-manager.js:24:21)
at new SqliteDialect (/app/node_modules/sequelize/lib/dialects/sqlite/index.js:15:30)
at new Sequelize (/app/node_modules/sequelize/lib/sequelize.js:340:20)
at Object.db.init (/app/database/index.js:34:20)
at createServer (/app/server.js:22:12)
at Command.<anonymous> (/app/cmd/web.js:18:26)
at Command.listener [as _actionHandler] (/app/node_modules/commander/lib/command.js:488:17)
at /app/node_modules/commander/lib/command.js:1227:65Possible solution:
I changed the Dockerfile to the following, and at least the error disappeared. Need to test further whether the container works as expected or not.
FROM node:14-alpine as builder
RUN apk add --no-cache build-base python3
WORKDIR /build
COPY ./package*.json ./
RUN npm i --only=production
FROM node:14-alpine
WORKDIR /app
COPY --from=builder /build/node_modules /app/node_modules
COPY . .
RUN npm link
# Added this line explicitly. Adding it in the builder context didn't work somehow.
RUN npm install sqlite3
CMD ["vocascan-server", "web"]
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
kind/bugSomething isn't workingSomething isn't workingkind/dependenciesPull request that updates a dependency filePull request that updates a dependency filekind/dockerEverything that has to do with dockerEverything that has to do with docker