-
Notifications
You must be signed in to change notification settings - Fork 30
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
1 parent
d39bd87
commit ac3221a
Showing
4 changed files
with
57 additions
and
9 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,14 +1,25 @@ | ||
FROM ctftraining/base_image_nginx_php_73 | ||
# FROM tutum/lamp | ||
FROM php:7.3-fpm-alpine | ||
|
||
RUN rm -r /var/www/html/index.php | ||
# 制作者信息 | ||
LABEL auther_template="CTF-Archives" | ||
|
||
COPY ./src/ /var/www/html | ||
COPY src /var/www/html | ||
|
||
RUN chown -R www-data:www-data /var/www/html | ||
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories &&\ | ||
apk add --update --no-cache nginx bash | ||
|
||
COPY ./service/docker-entrypoint.sh /docker-entrypoint.sh | ||
|
||
RUN chmod +x /docker-entrypoint.sh | ||
|
||
ENTRYPOINT ["/bin/sh","/docker-entrypoint.sh"] | ||
COPY ./config/nginx.conf /etc/nginx/nginx.conf | ||
|
||
RUN chown -R www-data:www-data /var/www/html | ||
|
||
WORKDIR /var/www/html | ||
|
||
# [可选]指定对外暴露端口,对于GZCTF等平台,强制EXPOSE可能会造成非预期端口泄露,请酌情启用 | ||
# EXPOSE 80 | ||
|
||
VOLUME ["/var/log/nginx"] | ||
|
||
ENTRYPOINT [ "/docker-entrypoint.sh" ] |
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,3 @@ | ||
# web-nginx-php73 | ||
|
||
部分容器逻辑参考自:[CTFTraining / base_image_nginx_php_73](https://github.com/CTFTraining/base_image_nginx_php_73),在此感谢[陌竹 - mozhu1024](https://github.com/mozhu1024)师傅做出的贡献 |
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,34 @@ | ||
# daemon off; | ||
|
||
worker_processes auto; | ||
|
||
events { | ||
worker_connections 1024; | ||
} | ||
|
||
http { | ||
include /etc/nginx/mime.types; | ||
default_type application/octet-stream; | ||
sendfile on; | ||
keepalive_timeout 65; | ||
|
||
server { | ||
listen 80; | ||
server_name localhost; | ||
root /var/www/html; | ||
index index.php index.html index.htm; | ||
|
||
location / { | ||
try_files $uri $uri/ /index.php?$args; | ||
} | ||
|
||
location ~ \.php$ { | ||
try_files $uri =404; | ||
fastcgi_pass 127.0.0.1:9000; | ||
fastcgi_index index.php; | ||
include fastcgi_params; | ||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | ||
} | ||
|
||
} | ||
} |
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