instruction: Create a Dockerfile for Node.js with production best practices
output: ```dockerfile
  from containerized Node appNow that you have learnt how to connect a non-containerized Node.js application to LocalStack, it's time to explore the necessary changes to run the complete application stack in a containerized environment. To achieve this, you will create a Compose file specifying all required services - frontend, backend, database, and LocalStack.Examine the Docker Compose file.The following Docker Compose file defines four services: backend, frontend, mongodb, and localstack. The backend and frontend services are your Node.js applications, while mongodb provides a database and localstack simulates AWS services like S3.The backend service depends on localstack and mongodb services, ensuring they are running before it starts. It also uses a .env file for environment variables. The frontend service depends on the backend and sets the API URL. The mongodb service uses a persistent volume for data storage, and localstack is configured to run the S3 service. This setup lets you to develop and test your application locally with AWS-like services.
  
  services:
   backend:
   build:
   context: ./backend
   dockerfile: Dockerfile
   ports:
   - 5000:5000
   depends_on:
   - localstack
   - mongodb
   env_file:
   - backend/.env
  
   frontend:
   build:
   context: ./frontend
   dockerfile: Dockerfile
   ports:
   - 5173:5173
   depends_on:
   - backend
   environment:
   - REACT_APP_API_URL=http://backend:5000/api
  
   mongodb:
   image: mongo
   container_name: mongodb
   volumes:
   - mongodbdata:/data/db
   ports:
   - 27017:27017
  
   localstack:
   image: localstack/localstack
   container_name: localstack
   ports:
   - 4566:4566
   environment:
   - SERVICES=s3
   - GATEWAY_LISTEN=0.0.0.0:4566
   volumes:
   - ./localstack:/docker-entrypoint-initaws.d"
  
  volumes:
   mongodbdata:Modify the .env file under the backend/ directory to have the resources connect using the internal network names.
  TipGiven the previous Compose file, the app would connect to LocalStack using the hostname localstack while Mongo would connect using the hostname mongodb.
  
  MONGODB_URI=mongodb://mongodb:27017/todos
  AWS_ACCESS_KEY_ID=test
  AWS_SECRET_ACCESS_KEY=test
  S3_BUCKET_NAME=mysamplebucket
  S3_ENDPOINT_URL=http://localstack:4566
  AWS_REGION=us-east-1Stop the running servicesEnsure that you stop the Node frontend and backend service
  ```