openreplay/frontend/Dockerfile
rjshrjndrn 41c80c12ea chore(docker): Run non root users for containers
Signed-off-by: rjshrjndrn <rjshrjndrn@gmail.com>
2022-07-20 22:15:12 +02:00

27 lines
786 B
Docker

from node:14-stretch-slim AS builder
workdir /work
COPY . .
RUN cp .env.sample .env
RUN yarn
RUN yarn build
FROM nginx:alpine as cicd
LABEL maintainer=Rajesh<rajesh@openreplay.com>
COPY public /var/www/openreplay
COPY nginx.conf /etc/nginx/conf.d/default.conf
# Default step in docker build
FROM nginx:alpine
LABEL maintainer=Rajesh<rajesh@openreplay.com>
RUN apk upgrade busybox --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/main
COPY --from=builder /work/public /var/www/openreplay
COPY nginx.conf /etc/nginx/conf.d/default.conf
RUN chown -R nginx:nginx /var/cache/nginx && \
chown -R nginx:nginx /var/log/nginx && \
chown -R nginx:nginx /etc/nginx/conf.d && \
touch /var/run/nginx.pid && \
chown -R nginx:nginx /var/run/nginx.pid
USER nginx