Skip to content

Commit

Permalink
Fixed docker build
Browse files Browse the repository at this point in the history
  • Loading branch information
SujithThirumalaisamy committed Jun 20, 2024
1 parent 54227ef commit a8ca663
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
8 changes: 5 additions & 3 deletions docker/sweeper/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,16 @@ COPY pnpm-workspace.yaml /usr/src/app/pnpm-workspace.yaml
COPY turbo.json /usr/src/app/turbo.json
COPY tsconfig.json /usr/src/app/tsconfig.json

RUN npm install pnpm -g -y

# Install dependencies
RUN pnpm install

# Generate Prisma client
RUN cd packages/db && DATABASE_URL=$DATABASE_URL pnpm dlx prisma generate

WORKDIR /usr/src/app
WORKDIR /usr/src/app/apps/sweeper

# Command to start both services
RUN pnpm run build --prefix apps/sweeper
CMD ["pnpm", "run", "start:sweeper"]
RUN pnpm run build
CMD ["pnpm", "run", "start"]
12 changes: 7 additions & 5 deletions docker/web/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ COPY ./apps/web /usr/src/app/apps/web
COPY package.json /usr/src/app/package.json
COPY pnpm-lock.yaml /usr/src/app/pnpm-lock.yaml
COPY pnpm-workspace.yaml /usr/src/app/pnpm-workspace.yaml
COPY turbo.json /usr/src/app/
COPY tsconfig.json /usr/src/app/
COPY turbo.json /usr/src/app/turbo.json
COPY tsconfig.json /usr/src/app/tsconfig.json

RUN npm install pnpm -g -y

# Install dependencies
RUN pnpm install
Expand All @@ -22,8 +24,8 @@ RUN cd packages/db && DATABASE_URL=$DATABASE_URL pnpm dlx prisma generate
# Expose ports for both applications
EXPOSE 3000

WORKDIR /usr/src/app
WORKDIR /usr/src/app/apps/web

# Command to start both services
RUN pnpm run build --prefix apps/web
CMD ["pnpm", "run", "start:web"]
RUN pnpm run build
CMD ["pnpm", "run", "start"]

0 comments on commit a8ca663

Please sign in to comment.