Skip to content

Commit

Permalink
Fix docker build for zookeeper
Browse files Browse the repository at this point in the history
  • Loading branch information
Jumail committed Dec 4, 2023
1 parent 3bd5d34 commit fe6b9b0
Showing 1 changed file with 25 additions and 5 deletions.
30 changes: 25 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,28 @@
# DEP STAGE
FROM node:18-alpine as deps

WORKDIR /app

# We need build tools if we need to build packages
RUN apk add --no-cache python3 make g++

# Fetch and install runtime dependencies
COPY package.json yarn.lock ./
RUN yarn install --production

###########################################

# BUILD STAGE
FROM node:18-alpine as build

WORKDIR /app

# Fetch dependencies
# We need build tools if we need to build packages
RUN apk add --no-cache python3 make g++

# Fetch runtime dependencies from deps stage
COPY --from=deps /app/node_modules ./node_modules
# Then install dev dependencies on top of that
COPY package.json yarn.lock ./
RUN yarn install

Expand All @@ -13,6 +32,8 @@ COPY . ./
# Build application
RUN yarn build

###########################################

# RUN STAGE
FROM node:18-alpine as run

Expand All @@ -27,13 +48,12 @@ ENV DISCORD_GENERAL_LOGGING_ENABLED=false
ENV DISCORD_REGISTER_COMMANDS=true
ENV DISCORD_REGISTER_COMMANDS_AS_GLOBAL=true

# Fetch runtime dependencies from deps stage
COPY --from=deps /app/node_modules ./node_modules

# Copy build source
COPY --from=build /app/built ./built

# Fetch runtime dependencies
COPY package.json yarn.lock ./
RUN yarn install --production

# Default ENV arguments for application
ENV REACTION_HANDLING_DISABLED=false
ENV GRAPHQL_DEBUG=false
Expand Down

0 comments on commit fe6b9b0

Please sign in to comment.