-
-
Notifications
You must be signed in to change notification settings - Fork 172
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
07f1647
commit 7dfd122
Showing
1 changed file
with
8 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
|
||
|
@@ -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" | ||
|
||
|