Skip to content

Commit

Permalink
docker file updated
Browse files Browse the repository at this point in the history
  • Loading branch information
EC2 Default User committed Dec 16, 2023
1 parent dee7d01 commit c075305
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 4 deletions.
26 changes: 22 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
FROM centos:7
RUN yum -y install httpd
COPY index.html /var/www/html/
# Use CentOS as the base image
FROM centos:latest

# Install Apache HTTP Server
RUN cd /etc/yum.repos.d/
RUN sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
RUN sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*

RUN yum -y update && \
yum -y install httpd && \
yum clean all

# Copy your HTML file into the container
COPY ./index.html /var/www/html/

# Optionally, you can also copy additional assets like CSS, JS, etc.
# COPY ./assets /var/www/html/assets

# Expose port 80 for Apache
EXPOSE 80
ENTRYPOINT ["/usr/sbin/httpd","-D","FOREGROUND"]

# Start Apache in the foreground
CMD ["/usr/sbin/httpd", "-D", "FOREGROUND"]
7 changes: 7 additions & 0 deletions httpd
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM centos:7
RUN yum -y update
RUN yum -y install epel-release && yum clean all
RUN yum -y install httpd mod_ssl lsof tree && yum clean all && systemctl enable httpd.service && systemctl start httpd.service
COPY index.html /var/www/html/
EXPOSE 80
ENTRYPOINT ["/usr/sbin/httpd","-D","FOREGROUND"]

0 comments on commit c075305

Please sign in to comment.