generated from bcgov/quickstart-openshift
-
Notifications
You must be signed in to change notification settings - Fork 2
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
efb9944
commit 1387c70
Showing
2 changed files
with
11 additions
and
25 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
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,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"] | ||
# Define the entrypoint | ||
ENTRYPOINT [ "sh", "initDB.sh" ] |