「🏗️」 wip: Should be working
This commit is contained in:
6
.env
Normal file
6
.env
Normal file
@ -0,0 +1,6 @@
|
||||
DB_USER=kanel
|
||||
|
||||
WP_ADMIN=kanel
|
||||
WP_MAIL=contact@kanel.ovh
|
||||
|
||||
FTP_USER=kanel
|
6
.gitignore
vendored
6
.gitignore
vendored
@ -1,5 +1,5 @@
|
||||
*/.env
|
||||
.env
|
||||
#*/.env
|
||||
#.env
|
||||
|
||||
.direnv
|
||||
secrets/
|
||||
#secrets/
|
||||
|
0
secrets/borg/passphrase.txt
Normal file
0
secrets/borg/passphrase.txt
Normal file
0
secrets/db/root_pass.txt
Normal file
0
secrets/db/root_pass.txt
Normal file
0
secrets/db/user_pass.txt
Normal file
0
secrets/db/user_pass.txt
Normal file
0
secrets/ftp/pass.txt
Normal file
0
secrets/ftp/pass.txt
Normal file
0
secrets/wp/admin_pass.txt
Normal file
0
secrets/wp/admin_pass.txt
Normal file
@ -16,8 +16,7 @@ if [ -f "${WP_DIR}/wp-config.php" ]; then
|
||||
else
|
||||
echo "Confiruring wordpress..."
|
||||
sleep 1
|
||||
echo $TZ
|
||||
wp --allow-root core config --dbname=${WP_DB_NAME} --dbuser=${WP_DB_USER} --dbpass=${WP_DB_PASS} --dbhost=${WP_DB_HOST} --dbprefix=wp_ --path=${WP_DIR}
|
||||
wp --allow-root core install --url=https://${WP_URL} --title="${WP_TITLE}" --admin_user=${WP_ADMIN_USER} --admin_password=${WP_ADMIN_PASS} --admin_email=${WP_ADMIN_EMAIL} --path=${WP_DIR}
|
||||
wp --allow-root core config --dbname=${WP_DB_NAME} --dbuser=${WP_DB_USER} --dbpass=$(getFileEnv WP_DB_PASS) --dbhost=${WP_DB_HOST} --dbprefix=wp_ --path=${WP_DIR}
|
||||
wp --allow-root core install --url=https://${WP_URL} --title="${WP_TITLE}" --admin_user=${WP_ADMIN_USER} --admin_password=$(getFileEnv WP_ADMIN_PASS) --admin_email=${WP_ADMIN_EMAIL} --path=${WP_DIR}
|
||||
wp option update blog_public ${WP_SEARCH_ENGINE_VISIBILITY} --allow-root
|
||||
fi
|
||||
|
@ -28,15 +28,15 @@ volumes:
|
||||
|
||||
secrets:
|
||||
ftp-pass:
|
||||
file: ../secrets/ftp/ftp_pass.txt
|
||||
file: ../secrets/ftp/pass.txt
|
||||
root-db-pass:
|
||||
file: ../secrets/db/root_db_pass.txt
|
||||
file: ../secrets/db/root_pass.txt
|
||||
user-db-pass:
|
||||
file: ../secrets/db/user_db_pass.txt
|
||||
file: ../secrets/db/user_pass.txt
|
||||
borg-passphrase:
|
||||
file: ../secrets/borg/borg_passphrase.txt
|
||||
file: ../secrets/borg/passphrase.txt
|
||||
wp-admin-pass:
|
||||
file: ../secrets/wp/wp_admin_pass.txt
|
||||
file: ../secrets/wp/admin_pass.txt
|
||||
|
||||
networks:
|
||||
inception:
|
||||
@ -79,11 +79,11 @@ services:
|
||||
db:
|
||||
condition: service_healthy
|
||||
environment:
|
||||
- WP_DB_NAME=knl
|
||||
- WP_DB_USER=kanel
|
||||
- WP_DB_NAME=${DB_NAME}
|
||||
- WP_DB_USER=${DB_USER}
|
||||
- WP_DB_PASS_FILE=/run/secrets/user-db-pass
|
||||
- WP_DB_HOST=db
|
||||
- WP_ADMIN_EMAIL=contact@kanel.ovh
|
||||
- WP_ADMIN_EMAIL=${WP_MAIL}
|
||||
- WP_ADMIN_USER=kanel
|
||||
- WP_ADMIN_PASS_FILE=/run/secrets/wp-admin-pass
|
||||
- WP_URL=adjoly.42.fr
|
||||
@ -112,8 +112,8 @@ services:
|
||||
environment:
|
||||
- MYSQL_ROOT_PASSWORD_FILE=/run/secrets/root-db-pass
|
||||
- MYSQL_PASSWORD_FILE=/run/secrets/user-db-pass
|
||||
- MYSQL_USER="kanel"
|
||||
- MYSQL_DATABASE="knl"
|
||||
- MYSQL_USER=${DB_USER}
|
||||
- MYSQL_DATABASE=${DB_NAME}
|
||||
volumes:
|
||||
- wp-db:/var/lib/mysql
|
||||
restart: unless-stopped
|
||||
@ -188,7 +188,7 @@ services:
|
||||
networks:
|
||||
- inception
|
||||
environment:
|
||||
- VSFTPD_USER=kanel
|
||||
- VSFTPD_USER=${FTP_USER}
|
||||
- VSFTPD_PASS_FILE=/run/secrets/ftp-pass
|
||||
volumes:
|
||||
- wp-site:/var/ftp
|
||||
|
@ -11,14 +11,14 @@ COPY cmd /build/cmd
|
||||
COPY internal /build/internal
|
||||
|
||||
RUN cd /build \
|
||||
&& go build git.keyzox.me/42_adjoly/inception/cmd/getEnvFile
|
||||
&& go build git.keyzox.me/42_adjoly/inception/cmd/getFileEnv
|
||||
|
||||
FROM scratch
|
||||
ADD docker/alpine/alpine-minirootfs-3.21.2-x86_64.tar.gz /
|
||||
|
||||
RUN apk add vsftpd tzdata
|
||||
|
||||
COPY --from=builder /build/getEnvFile /bin/getEnvFile
|
||||
COPY --from=builder /build/getFileEnv /bin/getFileEnv
|
||||
COPY docker/bonus/vsftpd/entry.sh /docker-entrypoint
|
||||
COPY docker/bonus/vsftpd/vsftpd.conf /etc/vsftpd/vsftpd.conf
|
||||
RUN chmod +x /docker-entrypoint
|
||||
|
@ -10,7 +10,8 @@ COPY cmd /build/cmd
|
||||
COPY internal /build/internal
|
||||
|
||||
RUN cd /build \
|
||||
&& go build git.keyzox.me/42_adjoly/inception/cmd/wordpress/entrypoint
|
||||
&& go build git.keyzox.me/42_adjoly/inception/cmd/wordpress/entrypoint \
|
||||
&& go build git.keyzox.me/42_adjoly/inception/cmd/getFileEnv
|
||||
|
||||
FROM scratch
|
||||
ADD docker/alpine/alpine-minirootfs-3.21.2-x86_64.tar.gz /
|
||||
@ -19,6 +20,7 @@ LABEL version="0.1"
|
||||
LABEL maintainer="KeyZox"
|
||||
|
||||
COPY --from=builder /build/entrypoint /docker-entrypoint
|
||||
COPY --from=builder /build/getFileEnv /bin/getFileEnv
|
||||
COPY docker/wordpress/www-docker.conf /www-docker.conf
|
||||
|
||||
RUN set -x \
|
||||
|
Reference in New Issue
Block a user