SQLite working with Docker path volume but not with the named one

584 Views Asked by At

I have Node.js app which is using Sequelize ORM for working with SQLite DB and umzug library for migrations. App is containerized with Docker.

When I run my container like:

docker run -v /home/user/data:/app/data image:tag

everything is working fine, but when I want to use named volume:

docker volume create appdata
docker run -v appdata:/app/data image:tag

I'm getting this error:

DatabaseError [SequelizeDatabaseError]: SQLITE_ERROR: duplicate column name: isPublic

Here is my Dockerfile:

FROM node:14-alpine

WORKDIR /app

COPY package*.json ./

RUN npm install

COPY . .

# Install client dependencies
RUN mkdir -p ./public ./data \
    && cd client \
    && npm install \
    && npm rebuild node-sass

# Build 
RUN npm run build \
    && mv ./client/build/* ./public

# Clean up src files
RUN rm -rf src/ ./client \
    && npm prune --production

EXPOSE 5000

ENV NODE_ENV=production

CMD ["node", "build/server.js"]

Any ideas what might be the reason? Something with permissions maybe?

0

There are 0 best solutions below