Docker run start services

I need nginx-openresty and redis in single docker container. I have written docker file its working fine. But thing i need to start my redis service after login into the docker bash to automate this I have written .sh file which contains instrutions like start and stop of redis server and nginx. ENTRYPOINT ["./startup.sh"]

and .sh file is

  • Docker cache confusion
  • Using AWS Simple Workflow to start a docker container
  • Amazon Elastic Beanstalk vs EC2 instance with docker containers
  • Docker access localhost
  • How do I configure ssh proxycommand correctly to run docker exec?
  • How to push a docker image with README file to docker hub?
  • cd /etc/redis-installation/utils
    echo -n | ./install_server.sh
    service redis_6379 stop
    cd /
    cp ./dump.rdb /var/lib/redis/6379/
    service redis_6379 start
    openresty
    

    My problem is that docker container start and exist when shell execution completed. How can stay the container keep running with nginx and redis in running state.

  • How to find the name of intermediate Docker images?
  • Docker swarm NFS volumes,
  • GAE Managed VMs - can't deploy if your project name is too long
  • Case sensitive host volume mount in docker for windows
  • Bash script behaves differently from Docker run command instead of inside container itself?
  • How to use Docker with Vue.js?
  • One Solution collect form web for “Docker run start services”

    Try using docker-compose with a link between your app container and your redis container. I suggest using the official redis container

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.