1
0

🏗️」 wip: Need to fix fileEnv func to rm newline at the env

This commit is contained in:
keyzox
2025-03-05 20:17:37 +01:00
parent 834468e1bd
commit 055ccdc1df
6 changed files with 22 additions and 15 deletions

View File

@ -36,6 +36,7 @@ clean: stop
docker system prune -f docker system prune -f
fclean: clean fclean: clean
sudo rm -Rf /home/adjoly/data/*/*
docker system prune -af docker system prune -af
docker volume prune -af docker volume prune -af

View File

@ -1,14 +1,14 @@
#!/bin/sh #!/bin/sh
WP_DIR="/var/www/wordpress" WP_DIR="/var/www/wordpress"
#WP_VERSION="6.7.2" WP_VERSION="6.7.2"
#if [ -f "$WP_DIR/index.php" ]; then if [ -f "$WP_DIR/index.php" ]; then
# echo "Already downloaded wordpress, skipping..." echo "Already downloaded wordpress, skipping..."
#else else
# echo "Downloading Wordpress ${WP_VERSION}" echo "Downloading Wordpress ${WP_VERSION}"
# wp --allow-root core download --version=${WP_VERSION} --path=${WP_DIR} wp --allow-root core download --version=${WP_VERSION} --path=${WP_DIR}
#fi fi
if [ -f "${WP_DIR}/wp-config.php" ]; then if [ -f "${WP_DIR}/wp-config.php" ]; then

View File

@ -65,7 +65,7 @@ services:
- ./configs/nginx/entry:/docker-entrypoint.d - ./configs/nginx/entry:/docker-entrypoint.d
- nginx-certs:/etc/nginx/ssl - nginx-certs:/etc/nginx/ssl
ports: ports:
- "8443:443" - "443:443"
restart: unless-stopped restart: unless-stopped
wordpress-php: wordpress-php:
@ -110,10 +110,10 @@ services:
networks: networks:
- inception - inception
environment: environment:
- MYSQL_ROOT_PASSWORD=alpine - MYSQL_ROOT_PASSWORD_FILE=/run/secrets/root-db-pass
- MYSQL_PASSWORD=alpine - MYSQL_PASSWORD_FILE=/run/secrets/user-db-pass
- MYSQL_USER=kanel - MYSQL_USER=${DB_USER}
- MYSQL_DATABASE=knl - MYSQL_DATABASE=${DB_NAME}
volumes: volumes:
- wp-db:/var/lib/mysql - wp-db:/var/lib/mysql
secrets: secrets:
@ -196,7 +196,7 @@ services:
volumes: volumes:
- wp-site:/var/ftp - wp-site:/var/ftp
ports: ports:
- 2100:21 - 21:21
- 30000-30100:30000-30100 - 30000-30100:30000-30100
secrets: secrets:
- ftp-pass - ftp-pass

View File

@ -27,7 +27,7 @@ EXPOSE 21
EXPOSE 30000-30100 EXPOSE 30000-30100
VOLUME /var/ftp VOLUME /var/ftp
STOPSIGNAL SIGTERM STOPSIGNAL SIGKILL
ENTRYPOINT [ "/docker-entrypoint" ] ENTRYPOINT [ "/docker-entrypoint" ]

View File

@ -11,7 +11,8 @@ COPY internal /build/internal
RUN cd /build \ RUN cd /build \
&& go build git.keyzox.me/42_adjoly/inception/cmd/mariadb/entrypoint \ && go build git.keyzox.me/42_adjoly/inception/cmd/mariadb/entrypoint \
&& go build git.keyzox.me/42_adjoly/inception/cmd/mariadb/healthcheck && go build git.keyzox.me/42_adjoly/inception/cmd/mariadb/healthcheck \
&& go build git.keyzox.me/42_adjoly/inception/cmd/getFileEnv
FROM scratch FROM scratch
ADD docker/alpine/alpine-minirootfs-3.21.2-x86_64.tar.gz / ADD docker/alpine/alpine-minirootfs-3.21.2-x86_64.tar.gz /
@ -24,6 +25,7 @@ RUN addgroup mysql \
COPY --from=builder /build/entrypoint /docker-entrypoint COPY --from=builder /build/entrypoint /docker-entrypoint
COPY --from=builder /build/healthcheck /docker-healthcheck COPY --from=builder /build/healthcheck /docker-healthcheck
COPY --from=builder /build/getFileEnv /bin/getFileEnv
RUN apk add --no-cache mariadb tzdata mariadb-client \ RUN apk add --no-cache mariadb tzdata mariadb-client \
&& chmod +x /docker-healthcheck \ && chmod +x /docker-healthcheck \

View File

@ -7,6 +7,10 @@ import (
"git.keyzox.me/42_adjoly/inception/internal/log" "git.keyzox.me/42_adjoly/inception/internal/log"
) )
func removeNl(in string) string {
}
// Check if the "Value" exist in the env if not check if a "Value_FILE" exist and if still not just return default value // Check if the "Value" exist in the env if not check if a "Value_FILE" exist and if still not just return default value
func FileEnv(Value, Default string) string { func FileEnv(Value, Default string) string {
val, is := os.LookupEnv(Value) val, is := os.LookupEnv(Value)