forked from globalbibletools/platform
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.server
More file actions
41 lines (33 loc) · 817 Bytes
/
Dockerfile.server
File metadata and controls
41 lines (33 loc) · 817 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# syntax=docker/dockerfile:1
FROM node:22-slim AS base
FROM base AS deps
WORKDIR /app
COPY package*.json .
RUN ["npm", "ci"]
FROM deps AS build
COPY --from=deps /app/node_modules ./node_modules
COPY . .
RUN ["npm", "run", "build"]
FROM base AS runner
WORKDIR /app
COPY package*.json .
RUN ["npm", "install", "@google-cloud/translate"]
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 app
USER app
EXPOSE 3000
ENV NODE_ENV=production
ENV PORT=3000
ENV HOSTNAME="0.0.0.0"
COPY --from=build --chown=app:nodejs /app/.output .
CMD ["node", "server/index.mjs"]
FROM node:22 AS dev
RUN apt-get update
RUN apt-get install -y postgresql-contrib
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
ENV PORT=3000
ENV NODE_ENV=development
EXPOSE 3000
CMD npm ci && npm run dev