Skip to content

Commit

Permalink
update Dockerfile for cloudbuild
Browse files Browse the repository at this point in the history
  • Loading branch information
AdenForshaw committed Oct 30, 2024
1 parent c11d3e2 commit 53f47a3
Showing 1 changed file with 21 additions and 19 deletions.
40 changes: 21 additions & 19 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,32 +1,34 @@
# Stage 1: Build the app
FROM node:22 AS build
FROM node:17-stretch

# Set the working directory
WORKDIR /app

# Copy the package.json and package-lock.json to the working directory
COPY package*.json ./

# Install the dependencies
RUN npm install --only=production
RUN npm install
RUN git --version

# Copy the rest of the application code
COPY . .
COPY src ./src
RUN ls ./

# Build the app
RUN npm run build
#ARG NODE_ENV=prod
#ENV NODE_ENV=${NODE_ENV}

# Stage 2: Create a smaller image for running the app
FROM node:22-slim
#COPY tools ./tools

# Set the working directory
WORKDIR /app
# placeholders for validation
RUN [ "touch",".env"]
RUN [ "touch",".env.staging"]
RUN [ "touch",".env.dev"]
RUN [ "touch",".env.production"]

COPY tsconfig.json .
COPY tsconfig.build.json .

RUN [ "npm", "run", "build"]

# Copy the built app from the build stage
COPY --from=build /app .

# Expose the application port (adjust if necessary)
EXPOSE 8080

# Start the app
CMD ["npm", "run", "start:prod"]
CMD [ "npm", "run", "start" ]
# COPY entrypoint.sh .
# ENTRYPOINT [ "/app/entrypoint.sh" ]

0 comments on commit 53f47a3

Please sign in to comment.