remicres commented on issue #8150:
URL: https://github.com/apache/apisix/issues/8150#issuecomment-1976672460

   Hi @lakewatcher ,
   
   Here is why I did (it was a while ago so it might need to be refreshed)
   
   dockerfile
   ```
   FROM apache/apisix
   COPY docker-entrypoint.sh /
   RUN chmod 755 /docker-entrypoint.sh
   ```
   
   The following seems to be a modified entrypoint, a bit ugly but it worked 
for my poc.
   
   docker-entrypoint.sh
   ```
   #!/usr/bin/env bash
   set -eo pipefail
   PREFIX=${APISIX_PREFIX:=/usr/local/apisix}
   if [[ "$1" == "docker-start" ]]; then
       if [ "$APISIX_STAND_ALONE" = "true" ]; then
           cat > ${PREFIX}/conf/config.yaml << _EOC_
   deployment:
     role: data_plane
     role_data_plane:
       config_provider: yaml
   _EOC_
   
           cat > ${PREFIX}/conf/apisix.yaml << _EOC_
   routes:
     -
       id: myserver
       uri: /*
       upstream:
         nodes:
           $TGT_HOST: 1 # ok
         type: roundrobin
       plugin_config_id: 1
   plugin_configs:
     -
       id: 1
       plugins:
         forward-auth:
           uri: $AUTH_URL
           request_headers: ["Authorization"],
   
   #END
   _EOC_
           /usr/bin/apisix init
       else
           /usr/bin/apisix init
           /usr/bin/apisix init_etcd
       fi
       
       exec /usr/local/openresty/bin/openresty -p /usr/local/apisix -g 'daemon 
off;'
   fi
   
   exec "$@"
   ```
   
   Build the docker image as `your:image` then test:
   
   ```commandLine
   docker run \
   -e AUTH_URL="http://some-server.com:8008/some/api"; \
   -d \
   --name apache-apisix \
   -p 9080:9080 \
   -e APISIX_STAND_ALONE=true your:image
   ```
   
   Hope that helps


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to