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

[DEPLOYMENT] #421

Open
erik-nilcoast opened this issue Dec 29, 2024 · 0 comments
Open

[DEPLOYMENT] #421

erik-nilcoast opened this issue Dec 29, 2024 · 0 comments
Labels
deployment Issues related to deploying AdventureLog

Comments

@erik-nilcoast
Copy link

Explain your issue

Currently docker networking seems to need to be enabled for the nginx.conf to work properly. I'm going to fork this project and provide a way to inject that via an environment variable.

Provide an obfuscated docker-compose.yml

job "adventure" {
  datacenters = ["dc1"]
  type = "batch"

  constraint {
    attribute = "${node.unique.id}"
    value     = "4bd60854-2bcd-43bf-d449-6db662db222f" ## nuc-222
  }

  group "adventure" {
    network {
      port "frontend" {
        static = 8015
        to = 3000
      }

      port "server" {
        static = 8017
        to = 8000
      }

      port "nginx" {
        static = 8016
        to = 80
      }
    }

    task "db" {
      driver = "docker"
      config {
        image = "postgis/postgis:15-3.3"
        volumes = [
          "/nomad/adventure-postgis:/var/lib/postgresql/data"
        ]
      }

      env {
        POSTGRES_DB = "database"
        POSTGRES_USER = "adventure"
        POSTGRES_PASSWORD = "changeme123"
      }
    }

    task "server" {
      driver = "docker"
      config {
        image = "ghcr.io/seanmorley15/adventurelog-backend:latest"
        volumes = [
          "/nomad/adventure:/code/media"
        ]
        ports = [
          "server",
          "nginx"
        ]
      }

      env {
        PGHOST = "db"
        PGDATABASE = "database"
        PGUSER = "adventure"
        PGPASSWORD = "changeme123"
        SECRET_KEY = "changeme123"
        DJANGO_ADMIN_USERNAME = "admin"
        DJANGO_ADMIN_PASSWORD = "admin"
        DJANGO_ADMIN_EMAIL = "[email protected]"
        PUBLIC_URL = "https://adventure-api.home.benoist.dev"
        CSRF_TRUSTED_ORIGINS = "https://adventure-api.home.benoist.dev,https://adventure.home.benoist.dev"
        DEBUG = "False"
        FRONTEND_URL = "https://adventure.home.benoist.dev"
      }

      resources {
        memory = 1000
      }
    }

    task "frontend" {
      driver = "docker"

      config {
        image = "ghcr.io/seanmorley15/adventurelog-frontend:latest"
        ports = [
          "frontend"
        ]
      }

      env {
        PUBLIC_SERVER_URL = "${NOMAD_ADDR_server}" # MOST DOCKER USERS WILL NOT NEED TO CHANGE THIS EVER EVEN IF YOU CHANGE THE OUTWARD PORT
        ORIGIN = "https://adventure.home.benoist.dev"
        BODY_SIZE_LIMIT = "Infinity"
      }

      resources {
        memory = 2000
      }
    }
  }
}

Really looking forward to getting this set up before a trip. Thank you so much for making this project public. I'll probably end up putting it to get use in Chile.

Provide any necessary logs from the containers and browser

@erik-nilcoast erik-nilcoast added the deployment Issues related to deploying AdventureLog label Dec 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployment Issues related to deploying AdventureLog
Projects
None yet
Development

No branches or pull requests

1 participant