Repository navigation
Expand file tree
/
Copy pathDockerfile.dev
More file actions
50 lines (39 loc) · 1.74 KB
/
Copy pathDockerfile.dev
File metadata and controls
50 lines (39 loc) · 1.74 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
FROM node:24-alpine3.22
# do not copy files we mount in compose
# our local and production docker files could co-exist using "targets" in
# the `FROM` statements
ENV PIP_BREAK_SYSTEM_PACKAGES=1
LABEL \
mitre.name=cveawg \
mitre.project=cveawg
# Run an optional pre-flight script for host-dependent reqs such as CA certs
# Use --build-arg:
# docker compose --build-arg CVE_PREFLIGHT="wget -q -O - --no-check-certificate http://pki.local/install_certs.sh | sh"
ARG CVE_PREFLIGHT
RUN sh -c "${CVE_PREFLIGHT:-exit 0}"
# Install python/pip (required for argon2 build from source)
ENV PYTHONUNBUFFERED=1
RUN apk add --update --no-cache python3 py3-pip
RUN pip3 install --no-cache --upgrade pip setuptools
# Install build essentials (also required for argon2) and git-based dependencies
RUN apk add --update --no-cache build-base git
# Set up directory to run as node user rather than root
ADD . /home/node/app
RUN chown -R node:node /home/node
RUN rm -Rf /home/node/app/.git
WORKDIR /home/node/app
# Run as the node user rather than root
USER node
# copy into development container only what we need to have
# Change db hostname from localhost to docdb for use inside docker
COPY --chown=node:node docker/default.json-docker /home/node/app/config/default.json
RUN npm install
RUN npm ci --prefix migrations --include=dev
COPY --chown=node:node docker/entrypoint.sh /home/node/app/entrypoint.sh
RUN echo '{}' > /home/node/app/config/development.json
RUN echo '{}' > /home/node/app/config/integration.json
RUN echo '{}' > /home/node/app/config/production.json
RUN echo '{}' > /home/node/app/config/test.json
RUN echo '{}' > /home/node/app/config/staging.json
# we don't need to expose ports that are exposed in our compose file
ENTRYPOINT '/home/node/app/entrypoint.sh'