diff --git a/backend/sites/Dockerfile b/backend/sites/Dockerfile index bfd14ec0..22c2e42a 100644 --- a/backend/sites/Dockerfile +++ b/backend/sites/Dockerfile @@ -10,6 +10,7 @@ RUN mkdir -p /home/node/.npm \ # Install packages, build, and keep only prod packages WORKDIR /app +#test # Copy package.json and package-lock.json COPY package*.json ./ @@ -34,4 +35,4 @@ RUN npm run build EXPOSE 4007 # Start the API -CMD ["sh", "start.sh"] +CMD ["sh", "start.sh"] \ No newline at end of file diff --git a/backend/sites/Dockerfile-migrations-openshift b/backend/sites/Dockerfile-migrations-openshift index 95a7be89..039bba73 100644 --- a/backend/sites/Dockerfile-migrations-openshift +++ b/backend/sites/Dockerfile-migrations-openshift @@ -1,39 +1,24 @@ FROM node:16.14.0-alpine -#FROM artifacts.developer.gov.bc.ca/docker-remote/node:14.17.1-alpine -# Set cache directory within the user's home directory +# Set npm cache directory ENV NPM_CONFIG_CACHE=/home/node/.npm +# Install packages, build, and keep only prod packages WORKDIR /app # A wildcard is used to ensure both package.json AND package-lock.json are copied -# Copy package.json and package-lock.json COPY package*.json ./ -# Set NODE_ENV environment variable - -RUN npm ci - - -#RUN npm build +# Install app dependencies using the `npm ci` command instead of `npm install` +RUN npm config set unsafe-perm true \ + && npm ci \ + && npm config set unsafe-perm false # Bundle app source COPY . . -# Set permissions for the application directory -RUN chmod -R 755 /app -# Ensure ownership of .npm folder -RUN mkdir -p /home/node/.npm \ - && chown -R node:node /home/node/.npm - -# Install PostgreSQL client if needed -# Install PostgreSQL client +# Install postgresql-client RUN apk add --no-cache postgresql-client -# Disable npm cache -RUN npm config set cache false -# Set executable permissions for scripts -RUN chmod +x initDB.sh - - -ENTRYPOINT ["sh", "initDB.sh"] \ No newline at end of file +# Define the entrypoint +ENTRYPOINT [ "sh", "initDB.sh" ] \ No newline at end of file