Skip to content

Commit

Permalink
Merge pull request #583 from infnibor/main
Browse files Browse the repository at this point in the history
Update Dockerfile
  • Loading branch information
LucasB25 authored Jun 24, 2024
2 parents 7441d73 + 1bdaf3c commit 48b2b37
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
# Stage 1: Build TypeScript
FROM node:21 as builder
FROM node:21 AS builder

WORKDIR /opt/lavamusic/


# Copy package files and install dependencies
COPY package*.json ./

RUN apt update
RUN apt install openssl -y
RUN apt update && apt install -y openssl

RUN npm install

RUN npm config set global --legacy-peer-deps

# Copy source code
Expand All @@ -29,7 +26,7 @@ RUN npm run build
# Stage 2: Create production image
FROM node:21-slim

ENV NODE_ENV production
ENV NODE_ENV=production

WORKDIR /opt/lavamusic/

Expand All @@ -42,13 +39,11 @@ COPY --from=builder /opt/lavamusic/scripts ./scripts
# Copy package files and install production dependencies
COPY package*.json ./

RUN apt update
RUN apt install openssl -y
RUN apt update && apt install -y openssl

RUN npm install --only=production

RUN npx prisma generate

RUN npx prisma db push

# Run as non-root user
Expand All @@ -61,4 +56,4 @@ RUN chown -R lavamusic:lavamusic /opt/lavamusic/
# Switch to the appropriate user
USER lavamusic

CMD [ "node", "dist/index.js" ]
CMD ["node", "dist/index.js"]

0 comments on commit 48b2b37

Please sign in to comment.