-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
EC2 Default User
committed
Dec 16, 2023
1 parent
dee7d01
commit c075305
Showing
2 changed files
with
29 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |