Skip to content

Commit

Permalink
refactor: overhaul Dockerfile and docker-compose.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
AlanMorel committed Nov 8, 2023
1 parent 779ec8f commit 8d8a4fb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
13 changes: 9 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
FROM node:20.1.0-alpine AS base

RUN apk add --update --no-cache openssl1.1-compat
WORKDIR /app

RUN npm install -g pnpm
ENV NODE_ENV production

WORKDIR /app
RUN npm install -g [email protected]

FROM base AS deps

COPY package.json pnpm-lock.yaml ./

RUN pnpm install --frozen-lockfile --prod

FROM base AS app

COPY . .
COPY --from=deps /app/node_modules ./node_modules

ENV NODE_ENV production
RUN pnpm ts:check

CMD ["pnpm", "start"]
4 changes: 1 addition & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ services:
build:
context: .
dockerfile: Dockerfile
target: base
environment:
DOCKER: "true"
target: app
volumes:
- "./logs:/app/logs"
networks:
Expand Down

0 comments on commit 8d8a4fb

Please sign in to comment.