I am trying to run some basic html pages using httpd docker image.
Dockerfile
FROM httpd:alpine COPY ./views /usr/local/apache2/htdocs/ # where my html pages stored COPY httpd.conf /usr/local/apache2/conf/httpd.conf RUN httpd -v EXPOSE 7074 httpd.conf
ServerName localhost Listen 7074 LoadModule mpm_event_module modules/mod_mpm_event.so docker-compose
version: '3' frontend_image: image: frontend_image build: context: ./frontend_image dockerfile: Dockerfile network_mode: "host" env_file: "./api.env" depends_on: - apigateway Then : sudo docker-compose up --build
RUN httpd -v gives:
Server version: Apache/2.4.43 (Unix) Server built: Apr 24 2020 15:46:58 But
Project_frontend_image_1 exited with code 1
How can I add an Entry-point to httpd, as I do not have apachectl2 in /usr/sbin.
refered : Docker run Exited 1 httpd
Edit :
I have tried docker run -dit --name my-apache-app -p 7575:80 -v "$PWD":/usr/local/apache2/htdocs/ httpd:2.4 and it works.
network_mode: host? (This will prevent it from connecting to theapigatewaycontainer, for example, which may be related to your problem.)network_mode: host, yet problem there. I used this as its easy to connect all services from localhost with ports.stdin_open: trueandtty: trueto my docker-compose file, yet same result. stackoverflow.com/questions/36249744/…