No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Quasar can't access environment variables in Docker container.

    Help
    2
    3
    632
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      Shard last edited by

      I’m using dotenv extension and can read environment variables with process.env
      after starting the client with quasar dev. Quasar can also read them when I build the client with quasar build and then serve it using quasar serve. However if I build and serve the client in docker quasar can no longer read the environment variables. I can confirm that correct environment variables are present inside the container by entering the running container and doing echo $VAR_NAME. What could possible be causing this behavior? Here is my docker compose for the client:

      client:
          container_name: quasar-client
          build:
            context: ./client
          expose:
            - 8080
          environment:
            HOST_SERVER: server
            AUTH0_DOMAIN: "${AUTH0_DOMAIN}"
            AUTH0_CLIENTID: ${AUTH0_CLIENTID}
            AUTH0_AUDIENCE: ${AUTH0_AUDIENCE}
          ports:
            - 80:8080
          depends_on:
            - server
          command: quasar serve dist/spa --hostname 0.0.0.0 --port 8080
      
      1 Reply Last reply Reply Quote 0
      • S
        Shard last edited by

        and here is the dockerfile itself:

        FROM node:lts-alpine as build-stage
        WORKDIR /app
        COPY package*.json ./
        RUN npm install -g @quasar/cli
        COPY . .
        RUN npm install
        RUN npm rebuild node-sass
        RUN quasar build
        
        EXPOSE 8080
        CMD ["quasar","serve"]
        
        1 Reply Last reply Reply Quote 0
        • arieltoledo
          arieltoledo last edited by

          Same issue did you manage to resolve this ?

          1 Reply Last reply Reply Quote 0
          • First post
            Last post