Skip to content

Commit

Permalink
update web-nginx-php73
Browse files Browse the repository at this point in the history
  • Loading branch information
Randark-JMT committed Oct 20, 2023
1 parent d39bd87 commit ac3221a
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 9 deletions.
25 changes: 18 additions & 7 deletions web-nginx-php73/Dockerfile
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" ]
3 changes: 3 additions & 0 deletions web-nginx-php73/README.md
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)师傅做出的贡献
34 changes: 34 additions & 0 deletions web-nginx-php73/config/nginx.conf
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;
}

}
}
4 changes: 2 additions & 2 deletions web-nginx-php73/docker/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ services:
build: ../
environment:
# 仅为测试用flag
FLAG: "flag{a63b4d37-7681-4850-b6a7-0d7109febb19}"
GZCTF_FLAG: "flag{a63b4d37-7681-4850-b6a7-0d7109febb19}"
ports:
# 设置了暴露端口
- 8080:8080
- 8080:80
restart: unless-stopped

0 comments on commit ac3221a

Please sign in to comment.