Skip to content

Commit

Permalink
🐳 Use entry point instead of cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
cristianpb committed Mar 5, 2024
1 parent f8ce7fb commit c0c7085
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#######################
# Step 1: Base target #
#######################
FROM --platform=$BUILDPLATFORM node:20 as development
FROM node:20 as development

ARG NPM_VERBOSE
ARG app_path
Expand All @@ -24,12 +24,12 @@ VOLUME ${app_path}/data

COPY tsconfig.json ./

CMD ["npm","run", "dev"]
ENTRYPOINT ["npm","run", "dev"]

##########################
# Step 3: "build" target #
##########################
FROM --platform=$BUILDPLATFORM development as build
FROM development as build
ARG app_path

WORKDIR $app_path
Expand All @@ -43,7 +43,7 @@ RUN npm run build
###############################
# Step 4: "production" target #
###############################
FROM --platform=$BUILDPLATFORM node:20-alpine as production
FROM node:20-alpine as production
ARG app_path

WORKDIR $app_path
Expand All @@ -60,4 +60,4 @@ VOLUME ${app_path}/data
COPY --from=build ${app_path}/node_modules ${app_path}/node_modules
COPY --from=build ${app_path}/dist ${app_path}/dist

CMD ["npm","run", "start"]
ENTRYPOINT ["npm","run", "start"]

0 comments on commit c0c7085

Please sign in to comment.