GithubHelp home page GithubHelp logo

Comments (1)

niklaszulus avatar niklaszulus commented on September 26, 2024 1

Solved:

Mistake on my part, due to SvelteKit being a framework that compiles down to Javascript it is a dev dependency and due to the nature of my project I haven't ran into any dependency issues, due to the fact there where non, until I installed the Directus SDK.

Solution:

Copy the node_modules folder into the production build (duh...)

FROM node:20.9-alpine3.17 AS base

FROM base AS deps
WORKDIR /app

COPY package*.json ./

RUN npm ci && npm cache clean --force

FROM base AS builder

ARG PUBLIC_SHOPIFY_ACCESS_TOKEN=${PUBLIC_SHOPIFY_ACCESS_TOKEN}
ARG PUBLIC_SHOPIFY_API_ENDPOINT=${PUBLIC_SHOPIFY_API_ENDPOINT}
ARG PUBLIC_DIRECTUS_URL=${PUBLIC_DIRECTUS_URL}

WORKDIR /app

COPY --from=deps /app/node_modules ./node_modules
COPY . .

RUN npm run build

RUN npm prune --omit-dev <----- OPTIMIZATION

FROM base as runner
WORKDIR /app

ENV NODE_ENV=production

COPY --from=builder /app/build ./build
COPY --from=deps /app/package.json ./
COPY --from=builder /app/node_modules ./node_modules <----- ADDED THIS LINE

USER node

EXPOSE 3000
CMD [ "node", "build" ]

from directus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.