File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed
01-contenedores/contenedores-iii/doom-web Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -16,16 +16,22 @@ FROM dependencies AS test
1616# Copy all files for testing
1717COPY . .
1818# Run tests
19- RUN npm run test
19+ RUN npm run test && echo "tests passed" > /tmp/tests-passed
2020
2121# ---- Release ----
2222FROM base AS release
23- # Add environment variables
24- # ENV NODE_ENV production
25- # Copy only necessary files
23+
24+ ENV NODE_ENV=production
25+
26+ # Copy tests validation file (forces test execution)
27+ COPY --from=test /tmp/tests-passed /tmp/
28+
29+ # Install only production dependencies
2630RUN npm install --omit=dev
31+
32+ # Copy all files
2733COPY . .
34+
2835# Expose port and define CMD
2936EXPOSE 3000
30- # Specify what command it'll execute when you create a container
3137CMD ["npm", "start"]
You can’t perform that action at this time.
0 commit comments