From 7dfd122851dfa7e4141f0b132bad005ee43dc3c2 Mon Sep 17 00:00:00 2001 From: akshatnema Date: Sat, 5 Oct 2024 18:53:57 +0530 Subject: [PATCH] changed dockerfile --- github-action/Dockerfile | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/github-action/Dockerfile b/github-action/Dockerfile index 2bb91aeba3f..94056e0f295 100644 --- a/github-action/Dockerfile +++ b/github-action/Dockerfile @@ -1,9 +1,5 @@ -FROM node:18-alpine - -# Create a non-root user -RUN addgroup -S myuser && adduser -S myuser -G myuser - -USER myuser +# Stage 1: Build stage with Node setup +FROM node:18-alpine AS build # Install necessary packages RUN apk add --no-cache bash git chromium @@ -12,19 +8,19 @@ RUN apk add --no-cache bash git chromium ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser -FROM ubuntu:latest +# Copy the asyncapi directory from the build stage +# Assuming you have a build stage, otherwise remove --from=build +COPY /tmp/asyncapi/ /asyncapi -# Copy the asyncapi directory -COPY tmp/asyncapi/ /asyncapi +# Create a non-root user +RUN addgroup -S myuser && adduser -S myuser -G myuser # Create a script that runs the desired command -RUN echo "#!/bin/bash\n/asyncapi/bin/run" > /usr/local/bin/asyncapi +RUN echo -e "#!/bin/bash\n/asyncapi/bin/run_bin" > /usr/local/bin/asyncapi # Make the script executable RUN chmod +x /usr/local/bin/asyncapi -RUN ls -l /usr/local/bin/asyncapi - # Change ownership to non-root user RUN chown -R myuser:myuser /asyncapi /usr/local/bin/asyncapi || echo "Failed to change ownership"