Skip to content

Commit

Permalink
docker (#122)
Browse files Browse the repository at this point in the history
Signed-off-by: Mirko Mollik <[email protected]>
  • Loading branch information
cre8 authored Oct 28, 2024
1 parent 9c9b65f commit 9075516
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
viewer/node_modules/
viewer/dist/
16 changes: 9 additions & 7 deletions viewer/Dockerfile → Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ FROM node:18-alpine AS build
# Set the working directory
WORKDIR /app

# Copy the package.json and package-lock.json files
COPY package*.json ./
# Copy package.json and package-lock.json first to leverage Docker caching
COPY viewer/package*.json ./viewer/

# Install dependencies
RUN npm ci
RUN cd viewer && npm ci

# Copy the rest of the application code
COPY . .

# Build the Angular application
RUN npm run build:ssr
RUN cd viewer && npm run build:ssr

# Stage 2: Serve the application using Node.js
FROM node:18-alpine
Expand All @@ -23,14 +23,16 @@ FROM node:18-alpine
WORKDIR /app

# Copy the built application from the previous stage
COPY --from=build /app/dist /app/dist
COPY --from=build /app/viewer/dist /app/dist

# Copy package.json and package-lock.json for production dependencies
COPY viewer/package*.json ./

# Install only production dependencies
COPY package*.json ./
RUN npm install --only=production

# Expose the port the app runs on
EXPOSE 4000

# Start the application
CMD ["npm", "run", "serve:ssr:viewer"]
CMD ["npm", "run", "serve:ssr:viewer"]
2 changes: 0 additions & 2 deletions viewer/.dockerignore

This file was deleted.

0 comments on commit 9075516

Please sign in to comment.