Skip to content

Commit

Permalink
Update dockerfile and environments for kuzzlerc and kourou.env
Browse files Browse the repository at this point in the history
  • Loading branch information
rolljee committed Oct 11, 2023
1 parent 59be019 commit 237ba60
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 16 deletions.
36 changes: 20 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,30 +1,34 @@
# Builder stage
FROM kuzzleio/kuzzle-runner:18 AS builder

ADD . /var/app

WORKDIR /var/app

RUN npm ci
RUN npm run build

FROM kuzzleio/kuzzle-runner:18 AS prepare
COPY . .

WORKDIR /var/app
ENV NODE_ENV=production

COPY --from=builder /var/app/package*.json /var/app/.npmrc* /var/app/dist ./
RUN npm install --production
RUN npm install
RUN npm run build
RUN npm prune --production

# Final image
FROM node:18-stretch-slim AS production
FROM node:18-bullseye-slim

ARG KUZZLE_ENV="local"
ARG KUZZLE_VAULT_KEY=""

ARG KUZZLE_VAULT_KEY
ENV KUZZLE_VAULT_KEY=$KUZZLE_VAULT_KEY
# Uncomment if you want to use the Kuzzle Vault
# See https://docs.kuzzle.io/core/2/guides/advanced/secrets-vault
# ENV KUZZLE_VAULT_KEY=$KUZZLE_VAULT_KEY
# ENV KUZZLE_SECRETS_FILE="/var/app/secrets.enc.json"

ENV NODE_ENV=production

WORKDIR /var/app
COPY --from=builder /var/app/dist /var/app
COPY --from=builder /var/app/node_modules /var/app/node_modules
COPY --from=builder /var/app/package.json /var/app/package.json
COPY --from=builder /var/app/package-lock.json /var/app/package-lock.json
COPY --from=builder /var/app/environments/${KUZZLE_ENV}/kuzzlerc /var/app/.kuzzlerc

COPY --from=prepare /var/app/ ./
WORKDIR /var/app

CMD [ "node", "app.js" ]
CMD [ "node", "app.js" ]
7 changes: 7 additions & 0 deletions environments/local/kourou.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
unset KUZZLE_HOST KUZZLE_PORT KUZZLE_USERNAME KUZZLE_PASSWORD

export KUZZLE_HOST=localhost
export KUZZLE_PORT=7512
export KUZZLE_USERNAME=admin
export KUZZLE_PASSWORD=admin

3 changes: 3 additions & 0 deletions environments/local/kuzzlerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"application": {}
}
7 changes: 7 additions & 0 deletions environments/main/kourou.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
unset KUZZLE_HOST KUZZLE_PORT KUZZLE_USERNAME KUZZLE_PASSWORD

export KUZZLE_HOST=localhost
export KUZZLE_PORT=7512
export KUZZLE_USERNAME=admin
export KUZZLE_PASSWORD=admin

3 changes: 3 additions & 0 deletions environments/main/kuzzlerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"application": {}
}

0 comments on commit 237ba60

Please sign in to comment.