Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Exclude host node_modules and build artifacts from the docker build context
**/node_modules
**/dist

# Logs, env files
npm-debug.log*
.env
.env.*

# OS files
.DS_Store

# Optional: ignore local Dockerfiles if you build from subfolders
#Dockerfile
8 changes: 7 additions & 1 deletion treasury/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ FROM node:${NODE_VERSION}-alpine AS builder

WORKDIR /usr/src/app

# Install build dependencies for native modules
RUN apk add --no-cache python3 make g++

COPY ./treasury/package*.json ./

RUN npm ci
Expand All @@ -15,6 +18,9 @@ RUN npm run build
FROM node:${NODE_VERSION}-alpine AS production
WORKDIR /usr/src/app

# Install build dependencies temporarily for production dependencies
RUN apk add --no-cache python3 make g++

COPY ./treasury/package*.json ./

RUN npm ci --production && npm cache clean --force
Expand All @@ -23,4 +29,4 @@ COPY --from=builder /usr/src/app/dist ./dist

EXPOSE 8080

CMD ["node", "dist/main"]
CMD ["node", "dist/src/main"]