Une collection organisée de snippets de code pour accélérer votre développement. Parcourez, recherchez et copiez en un clic.
FROM node:18 as builder
WORKDIR /app
COPY . .
RUN npm run build
FROM nginx:stable-alpine
COPY --from=builder /app/build /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
docker build -t mon-image:latest .
docker push mon-registre/mon-image:latest
version: '3.8'
services:
web:
build: .
ports:
- "8000:8000"
redis:
image: "redis:alpine"
FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY . .
EXPOSE 3000
CMD [ "node", "server.js" ]
node_modules
npm-debug.log
.env
Dockerfile
.git
HEALTHCHECK --interval=30s --timeout=3s \
CMD curl -f http://localhost/ || exit 1