Skip to content

Commit

Permalink
Updated dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidOkulski committed Jan 9, 2025
1 parent fa6d5ac commit 82a8e92
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ FROM node:20
# Set working directory and prepare permissions
WORKDIR /usr/app

# Copy and install backend dependencies
COPY ./app/src/package*.json ./src/
RUN npm install --prefix ./src

Expand All @@ -11,6 +12,7 @@ COPY ./app/src ./src
# React app setup
WORKDIR /usr/app/client

# Copy and install React app dependencies
COPY ./app/client/package*.json ./package.json
COPY ./app/client/package-lock.json ./package-lock.json
RUN npm install
Expand All @@ -20,14 +22,17 @@ COPY ./app/client/ .
# Inject REACT_APP_SSO_URL into the React app during the build
ARG REACT_APP_SSO_URL
ENV REACT_APP_SSO_URL=${REACT_APP_SSO_URL}
RUN echo "REACT_APP_SSO_URL=${REACT_APP_SSO_URL}" > .env

# Build the React app
RUN npm run build

# Adjust directory and file permissions for OpenShift
WORKDIR /usr/app/src
RUN chgrp -R 0 /usr/app && \
chmod -R g=u /usr/app

# Set the app port
ARG APP_PORT
ENV APP_PORT=${APP_PORT}
EXPOSE ${APP_PORT}
Expand Down

0 comments on commit 82a8e92

Please sign in to comment.