-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathDockerfile.auth
More file actions
50 lines (46 loc) · 2.07 KB
/
Dockerfile.auth
File metadata and controls
50 lines (46 loc) · 2.07 KB
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
42
43
44
45
46
47
48
49
50
# Railway Dockerfile for auth-service.
# Identical build pipeline to the main Dockerfile, but only produces the
# auth-service final image. Railway does not support --target in config-as-code,
# so each service has its own Dockerfile.
# -- Base --
FROM node:20-alpine AS base
RUN corepack enable && corepack prepare pnpm@9.15.9 --activate
RUN addgroup -g 1001 appuser && adduser -u 1001 -G appuser -D appuser
WORKDIR /app
COPY package.json pnpm-workspace.yaml pnpm-lock.yaml* ./
COPY packages/shared/package.json packages/shared/
COPY packages/auth-service/package.json packages/auth-service/
COPY packages/pds-core/package.json packages/pds-core/
# -- Dependencies --
FROM base AS deps
RUN pnpm install --frozen-lockfile
# -- Build --
FROM deps AS build
COPY packages/ packages/
COPY tsconfig.json ./
RUN pnpm --filter @certified-app/auth-service... build
# -- Auth Service --
FROM node:20-alpine
RUN addgroup -g 1001 appuser && adduser -u 1001 -G appuser -D appuser
RUN apk add --no-cache wget su-exec
WORKDIR /app
COPY --from=build /app/node_modules ./node_modules
COPY --from=build /app/packages/shared/node_modules ./packages/shared/node_modules
COPY --from=build /app/packages/auth-service/node_modules ./packages/auth-service/node_modules
COPY --from=build /app/packages/shared/dist ./packages/shared/dist
COPY --from=build /app/packages/shared/package.json ./packages/shared/
COPY --from=build /app/packages/auth-service/dist ./packages/auth-service/dist
COPY --from=build /app/packages/auth-service/package.json ./packages/auth-service/
COPY packages/auth-service/public ./packages/auth-service/public
COPY --from=build /app/package.json ./
COPY --from=build /app/pnpm-workspace.yaml ./
COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
# Stamp the ePDS version into the image.
ARG RAILWAY_GIT_COMMIT_SHA
COPY .epds-version* ./
COPY scripts/resolve-version.sh /tmp/
RUN /tmp/resolve-version.sh && rm /tmp/resolve-version.sh
ENV DB_LOCATION=/data/epds.sqlite
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["node", "packages/auth-service/dist/index.js"]