1
0

🏗️」 wip: everything should be fixed

This commit is contained in:
2025-01-18 16:38:11 +01:00
parent 9a8f33f0b4
commit fbdfcef494
4 changed files with 9 additions and 10 deletions

View File

@ -50,18 +50,18 @@ func main() {
makeFpmConf() makeFpmConf()
_, err := os.ReadFile("/usr/src/wordpress/wp-config.php") _, err := os.ReadFile("/var/www/html/wp-config.php")
if err != nil && env.IsEnvSet("WORDPRESS_") { if err != nil && env.IsEnvSet("WORDPRESS_") {
content, err := os.ReadFile("/usr/src/wordpress/wp-config-docker.php") content, err := os.ReadFile("/var/www/html/wp-config-docker.php")
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)
} }
res := bytes.Replace([]byte(content), []byte("put your unique phrase here"), []byte(pass.GenStrPass(32)), -1) res := bytes.Replace([]byte(content), []byte("put your unique phrase here"), []byte(pass.GenStrPass(32)), -1)
if err := os.WriteFile("/usr/src/wordpress/wp-config.php", res, 0660); err != nil { if err := os.WriteFile("/var/www/html/wp-config.php", res, 0660); err != nil {
log.Fatal(err) log.Fatal(err)
} }
cmd := exec.Command("chown", "www-data:www-data", "/usr/src/wordpress/wp-config.php") cmd := exec.Command("chown", "www-data:www-data", "/var/www/html/wp-config.php")
cmd.Stdout = os.Stdout cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr cmd.Stderr = os.Stderr
if err := cmd.Run(); err == nil { if err := cmd.Run(); err == nil {

View File

@ -3,7 +3,7 @@ server {
server_name adjoly.42.fr www.adjoly.42.fr; server_name adjoly.42.fr www.adjoly.42.fr;
root /var/www/html/; root /var/www/html;
index index.php; index index.php;
ssl_certificate $NGINX_SSL_CERT_FILE; ssl_certificate $NGINX_SSL_CERT_FILE;
@ -14,13 +14,13 @@ server {
keepalive_timeout 60; keepalive_timeout 60;
location / { location / {
try_files $uri $uri/ =404; try_files $${q}uri $${q}uri/ =404;
} }
location ~ \.php$ { location ~ \.php$ {
include fastcgi.conf;
fastcgi_pass $NGINX_PHP_HOST:9000; fastcgi_pass $NGINX_PHP_HOST:9000;
fastcgi_index index.php; fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_split_path_info ^(.+\.php)(/.+)$;
include fastcgi.conf;
} }
} }

View File

@ -31,8 +31,7 @@ services:
- ./configs/nginx/templates:/etc/nginx/templates - ./configs/nginx/templates:/etc/nginx/templates
- ./configs/nginx/entry:/docker-entrypoint.d - ./configs/nginx/entry:/docker-entrypoint.d
ports: ports:
- "8443:443" - "443:443"
- "8080:80"
restart: unless-stopped restart: unless-stopped
wordpress-php: wordpress-php:

View File

@ -12,7 +12,7 @@ COPY cmd /build/cmd
COPY internal /build/internal COPY internal /build/internal
COPY docker/wordpress/www-docker.conf /www-docker.conf COPY docker/wordpress/www-docker.conf /www-docker.conf
RUN apk add --no-cache go curl php84-fpm tzdata fcgi \ RUN apk add --no-cache go curl php84-mysqli php84-fpm tzdata fcgi \
&& cd /build \ && cd /build \
&& go build git.keyzox.me/42_adjoly/inception/cmd/wordpress/entrypoint \ && go build git.keyzox.me/42_adjoly/inception/cmd/wordpress/entrypoint \
&& cp /build/entrypoint /docker-entrypoint \ && cp /build/entrypoint /docker-entrypoint \