mirror of
https://github.com/pacnpal/markov-discord.git
synced 2025-12-26 13:26:55 -05:00
typeorm 0.3, Dockerfile optmizations
This commit is contained in:
15
Dockerfile
15
Dockerfile
@@ -7,6 +7,17 @@ WORKDIR /usr/app
|
||||
|
||||
RUN apk add --no-cache tini
|
||||
|
||||
############
|
||||
# PROD DEPS
|
||||
############
|
||||
|
||||
FROM base as prodDeps
|
||||
|
||||
COPY package*.json ./
|
||||
# Install build tools for erlpack, then install prod deps only
|
||||
RUN apk add --no-cache make gcc g++ python3 \
|
||||
&& npm ci --only=production
|
||||
|
||||
########
|
||||
# BUILD
|
||||
########
|
||||
@@ -36,13 +47,13 @@ FROM base as deploy
|
||||
USER node
|
||||
|
||||
# Steal node_modules from base image
|
||||
COPY --from=build /usr/app/node_modules node_modules
|
||||
COPY --from=prodDeps /usr/app/node_modules node_modules
|
||||
|
||||
# Steal compiled code from build image
|
||||
COPY --from=build /usr/app/dist dist
|
||||
|
||||
# Copy package.json for version number
|
||||
COPY package*.json ormconfig.js ./
|
||||
COPY package.json ./
|
||||
|
||||
# RUN mkdir config
|
||||
|
||||
|
||||
Reference in New Issue
Block a user