signoz/frontend/Dockerfile
Yunus M 8324d010ae
fix: frontend/Dockerfile to reduce vulnerabilities (#3589)
The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-ALPINE317-LIBWEBP-5902239

Co-authored-by: snyk-bot <snyk-bot@snyk.io>
2023-09-20 11:32:17 +05:30

40 lines
719 B
Docker

# Builder stage
FROM node:16.15.0 as builder
# Add Maintainer Info
LABEL maintainer="signoz"
ARG TARGETOS=linux
ARG TARGETARCH
WORKDIR /frontend
# Copy the package.json and .yarnrc files prior to install dependencies
COPY package.json ./
# Copy lock file
COPY yarn.lock ./
COPY .yarnrc ./
# Install the dependencies and make the folder
RUN CI=1 yarn install
COPY . .
# Build the project and copy the files
RUN yarn build
FROM nginx:1.25.2-alpine
COPY conf/default.conf /etc/nginx/conf.d/default.conf
# Remove default nginx index page
RUN rm -rf /usr/share/nginx/html/*
# Copy from the stahg 1
COPY --from=builder /frontend/build /usr/share/nginx/html
EXPOSE 3301
ENTRYPOINT ["nginx", "-g", "daemon off;"]