-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathDockerfile.local
More file actions
38 lines (25 loc) · 946 Bytes
/
Dockerfile.local
File metadata and controls
38 lines (25 loc) · 946 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
# The main purpose of this Dockerfile is to test that ensembl-client
# builds and runs correctly in a docker environment.
# You can also use it to build and run ensembl-client instance locally,
# if you prefer that over running Node directly on your machine.
FROM node:24.11.0 AS builder
ARG SOURCE_DIR="./"
RUN mkdir -p /srv/ensembl-client
COPY ${SOURCE_DIR} /srv/ensembl-client/
WORKDIR /srv/ensembl-client/
# to run playwright tests in headless mode
ENV CI=true
RUN npm ci --loglevel warn && \
npx playwright install chromium --with-deps && \
npm run test && \
npm run build
# PRODUCTION IMAGE
FROM node:24.11.0-alpine AS runner
RUN mkdir -p /srv/ensembl-client
WORKDIR /srv/ensembl-client/
ENV NODE_ENV=production
COPY --from=builder /srv/ensembl-client/package* ./
COPY --from=builder /srv/ensembl-client/dist ./dist/
RUN npm ci --only=production --ignore-scripts
EXPOSE 8080
CMD [ "node", "dist/server/server.js" ]