forked from try-bridgecrew/codegoat
-
Notifications
You must be signed in to change notification settings - Fork 1
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
960a020
commit 0daaf16
Showing
1 changed file
with
28 additions
and
9 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,28 @@ | ||
FROM node:10-alpine | ||
RUN mkdir /app | ||
RUN groupadd -r johnnycodev && useradd -r -s /bin/false -g johnnycodev johnnycodev | ||
WORKDIR /app | ||
COPY . /app | ||
RUN chown -R johnnycodev:johnnycodev /app | ||
USER johnnycodev | ||
CMD node index.js | ||
EXPOSE 80 | ||
FROM ubuntu:jammy-20221020 | ||
|
||
# Disable Prompt During Packages Installation | ||
ARG DEBIAN_FRONTEND=noninteractive | ||
|
||
# Update Ubuntu Software repository | ||
RUN apt update | ||
|
||
# Install nginx, php-fpm and supervisord from ubuntu repository | ||
RUN apt install -y nginx php-fpm supervisor && \ | ||
rm -rf /var/lib/apt/lists/* && \ | ||
apt clean | ||
|
||
# Define the ENV variable | ||
ENV nginx_vhost /etc/nginx/sites-available/default | ||
ENV php_conf /etc/php/7.4/fpm/php.ini | ||
ENV nginx_conf /etc/nginx/nginx.conf | ||
ENV supervisor_conf /etc/supervisor/supervisord.conf | ||
|
||
RUN mkdir -p /run/php && \ | ||
chown -R www-data:www-data /var/www/html && \ | ||
chown -R www-data:www-data /run/php | ||
|
||
# Volume configuration | ||
VOLUME ["/etc/nginx/sites-enabled", "/etc/nginx/certs", "/etc/nginx/conf.d", "/var/log/nginx", "/var/www/html"] | ||
|
||
# Expose Port for the Application | ||
EXPOSE 80 443 |