Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #29 DockerFile for MACOS compatibility commands #30

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions EcoSonar-API/Dockerfile-MACOS
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Use the official Node.js image for macOS
FROM node:21.6.2-alpine

# Uncomment if you need to configure proxy.
#ENV HTTP_PROXY=$http_proxy
#ENV HTTPS_PROXY=$https_proxy
#ENV NO_PROXY=$no_proxy

# Install necessary packages
RUN apk update \
&& apk add --no-cache \
chromium \
nss \
freetype \
freetype-dev \
harfbuzz \
ca-certificates \
ttf-freefont \
nodejs \
npm

# Create app directory
WORKDIR /app

# Bundle app source
COPY . .

# Uncomment if you need to configure proxy.
#RUN npm config set proxy $HTTP_PROXY

# If you are building your code for production
# RUN npm ci --only=production
# otherwise run npm install
RUN npm install

# Set up user and directories
RUN addgroup -S pptruser && \
adduser -S -G pptruser pptruser && \
addgroup pptruser audio && \
addgroup pptruser video && \
mkdir -p /home/pptruser/Downloads && \
chown -R pptruser:pptruser /home/pptruser && \
chown -R pptruser:pptruser /app/

USER pptruser

# To avoid "Error: ENOENT: no such file or directory, open '/app/dist/bundle.js'"
RUN npm i

ENV PORT=3000
EXPOSE 3000

CMD ["npm", "start"]