Hi oot4chi, here’s a brief recommendation for your deployment strategy:
Because your build relies on an external license server, you must ensure that the build environment can reliably access that server. If your production server doesn’t have guaranteed network access to the license service during the Docker build, you’re likely to run into activation issues. In that case, it’s safer to perform the build locally (or on a dedicated CI/CD machine that does have the necessary access) and then deploy the built artifacts (for example, the dist/ folder) to your server.
A common approach is using a multi-stage Docker build. In the first stage, you build your project in an environment where the license server is accessible; in the final stage, you copy over just the built output, preventing any license verification issues during runtime. Here’s a sample Dockerfile illustrating this setup:
# Stage 1: Build using an image with access to the license server
FROM node:16 as builder
WORKDIR /app
COPY package*.json .
RUN npm install
COPY . .
# Ensure the environment can reach the license server before building
RUN npm run build
# Stage 2: Production image with built artifacts
FROM node:16
WORKDIR /app
COPY --from=builder /app/dist ./dist
EXPOSE 3000
CMD ["node", "dist/index.js"]
This pattern lets you keep the sensitive build requirements (like license server access) confined to the build stage, while the final image remains lean and independent.
I trust this helps clarify your deployment choice. For further details on integrating Needle Engine components within your project, feel free to ask.
1 replies left - Become PRO for more replies. thread_LbZIK1e2lyyomwjM7gXCRsa6 Reply to this post directly if you need further help (bottom right button)
Hi, you can use an access token to validate, then no local license server is needed and everything can run as part of your docker process (1)
Just set it as an environment variable NEEDLE_CLOUD_TOKEN and make sure it’s available in your docker container. See the docs here: Needle Cloud | Needle Engine Documentation (create the token with read write access in your needle cloud team that you have the license for)