Skip to content

Commit

Permalink
test sites
Browse files Browse the repository at this point in the history
  • Loading branch information
sakthi-aot committed May 8, 2024
1 parent 1387c70 commit b20d485
Showing 1 changed file with 20 additions and 9 deletions.
29 changes: 20 additions & 9 deletions backend/sites/Dockerfile-migrations-openshift
Original file line number Diff line number Diff line change
@@ -1,24 +1,35 @@
FROM node:16.14.0-alpine

# Set npm cache directory
# Set cache directory within the user's home 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 ./

# 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
# Set NODE_ENV environment variable
RUN npm ci

# Bundle app source
COPY . .

# Install postgresql-client
# 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
RUN apk add --no-cache postgresql-client

# Define the entrypoint
ENTRYPOINT [ "sh", "initDB.sh" ]
# Disable npm cache
RUN npm config set cache false

# Set executable permissions for scripts
RUN chmod +x initDB.sh

ENTRYPOINT ["sh", "initDB.sh"]

0 comments on commit b20d485

Please sign in to comment.