Skip to content

Commit

Permalink
changed dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
akshatnema committed Oct 5, 2024
1 parent 07f1647 commit 7dfd122
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions github-action/Dockerfile
Original file line number Diff line number Diff line change
@@ -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

Check notice

Code scanning / SonarCloud

Arguments in long RUN instructions should be sorted Low

Sort these package names alphanumerically. See more on SonarCloud
Expand All @@ -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"

Expand Down

0 comments on commit 7dfd122

Please sign in to comment.