Update Dockerfile
This commit is contained in:
parent
24d8ab6763
commit
18e468b17f
11
Dockerfile
11
Dockerfile
@ -1,7 +1,6 @@
|
||||
# dev stage
|
||||
FROM node:14-alpine as dev
|
||||
WORKDIR /app
|
||||
RUN apk update && apk add --no-cache python3 make gcc g++
|
||||
COPY package*.json ./
|
||||
RUN npm ci
|
||||
COPY . .
|
||||
@ -14,21 +13,13 @@ RUN npx tsc && npm prune --production
|
||||
FROM node:14-alpine
|
||||
WORKDIR /app
|
||||
|
||||
RUN printf "%b" '#!'"/bin/sh\n\
|
||||
set -e\n\
|
||||
if [ ! -z \"\$RUN_MIGRATIONS\" ]; then\n\
|
||||
echo \"Running migrations.\"\n\
|
||||
npm run knex:migrate:latest\n\
|
||||
fi\n\
|
||||
exec \"\$@\"\n" > docker-entrypoint.sh && chmod +x docker-entrypoint.sh
|
||||
RUN apk add --update --no-cache util-linux
|
||||
|
||||
# Copy over production modules and dist folder
|
||||
COPY --from=build /app/package*.json ./
|
||||
COPY --from=build /app/node_modules ./node_modules
|
||||
COPY --from=build /app/dist ./dist
|
||||
COPY --from=build /app/db ./db
|
||||
|
||||
EXPOSE 4000
|
||||
|
||||
ENTRYPOINT [ "./docker-entrypoint.sh" ]
|
||||
CMD [ "node", "dist/main.js" ]
|
||||
|
Loading…
Reference in New Issue
Block a user