mirror of
https://github.com/darksaid98/cadence-discord-bot.git
synced 2026-12-03 22:15:37 +00:00
fix: update Dockerfile and CI/CD workflows
This commit is contained in:
1 parent
7185fe4071
commit
f21bfbae6f
5 files changed
+33
-22
No files matched your search
+11
-3
@@ -13,16 +13,24 @@ RUN apk add --no-cache python3 make build-base ffmpeg
|
||||
WORKDIR /cadence-discord-bot
|
||||
|
||||
# Copy the rest of the source files into the image.
|
||||
COPY . .
|
||||
COPY package*.json ./
|
||||
COPY tsconfig.json ./
|
||||
COPY src/ ./src/
|
||||
COPY config/ ./config/
|
||||
|
||||
# Install dependencies from package-lock.json and omit dev dependencies
|
||||
# Leverage a cache mount to /root/.npm to speed up subsequent builds.
|
||||
RUN --mount=type=cache,target=/root/.npm \
|
||||
npm ci
|
||||
|
||||
# Transpile TypeScript to JavaScript, remove dev dependencies, and install production dependencies
|
||||
RUN npm run build && \
|
||||
rm -rf node_modules && \
|
||||
npm ci --omit=dev
|
||||
|
||||
# Cleanup of unneeded packages and apk cache
|
||||
# Cleanup of unneeded packages, apk cache, and TypeScript source files
|
||||
RUN apk del python3 make build-base && \
|
||||
rm -rf /var/cache/apk/* /tmp/*
|
||||
rm -rf /var/cache/apk/* /tmp/* ./src/
|
||||
|
||||
# Startup command to run the bot after deploying slash commands
|
||||
CMD /bin/sh -c "npm run deploy && npm run start"
|
||||
Reference in new issue
Block a user