Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker compose modification #56

Open
dranoto opened this issue Dec 27, 2024 · 0 comments
Open

Docker compose modification #56

dranoto opened this issue Dec 27, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@dranoto
Copy link

dranoto commented Dec 27, 2024

The default docker compose example exposes the port to the mongodb, pins it to 0.0.0.0 by default. For security awareness, especially new users running this compose file on a VPS, it should be referenced by name rather than open the port. Then the DB can only be accessed from within the docker local network that is created between these two services.

services:
  app:
    image: sanjeet990/astroluma:latest
    container_name: astroluma
    ports:
      - 8000:8000
    environment:
      PORT: 8000
      NODE_ENV: production
      SECRET_KEY: a2c5f9a8b2d7e1a7f2c9c8d9b5f7a3d5
      MONGODB_URI: mongodb://mongodb:27017/astroluma  # Connect to MongoDB by service name
    volumes:
      - uploads_data:/app/storage/uploads
    depends_on:
      - mongodb
    restart: always
    # Removed network_mode: host

  mongodb:
    image: mongo:6.0
    container_name: astroluma_mongodb
    # Removed ports: - "27017:27017" 
    volumes:
      - mongo_data:/data/db
    restart: always

volumes:
  mongo_data:
  uploads_data:

@dranoto dranoto added the bug Something isn't working label Dec 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants