「🏗️」 wip: Need to fix fileEnv func to rm newline at the env
This commit is contained in:
1
Makefile
1
Makefile
@ -36,6 +36,7 @@ clean: stop
|
||||
docker system prune -f
|
||||
|
||||
fclean: clean
|
||||
sudo rm -Rf /home/adjoly/data/*/*
|
||||
docker system prune -af
|
||||
docker volume prune -af
|
||||
|
||||
|
@ -1,14 +1,14 @@
|
||||
#!/bin/sh
|
||||
|
||||
WP_DIR="/var/www/wordpress"
|
||||
#WP_VERSION="6.7.2"
|
||||
WP_VERSION="6.7.2"
|
||||
|
||||
#if [ -f "$WP_DIR/index.php" ]; then
|
||||
# echo "Already downloaded wordpress, skipping..."
|
||||
#else
|
||||
# echo "Downloading Wordpress ${WP_VERSION}"
|
||||
# wp --allow-root core download --version=${WP_VERSION} --path=${WP_DIR}
|
||||
#fi
|
||||
if [ -f "$WP_DIR/index.php" ]; then
|
||||
echo "Already downloaded wordpress, skipping..."
|
||||
else
|
||||
echo "Downloading Wordpress ${WP_VERSION}"
|
||||
wp --allow-root core download --version=${WP_VERSION} --path=${WP_DIR}
|
||||
fi
|
||||
|
||||
|
||||
if [ -f "${WP_DIR}/wp-config.php" ]; then
|
||||
|
@ -65,7 +65,7 @@ services:
|
||||
- ./configs/nginx/entry:/docker-entrypoint.d
|
||||
- nginx-certs:/etc/nginx/ssl
|
||||
ports:
|
||||
- "8443:443"
|
||||
- "443:443"
|
||||
restart: unless-stopped
|
||||
|
||||
wordpress-php:
|
||||
@ -110,10 +110,10 @@ services:
|
||||
networks:
|
||||
- inception
|
||||
environment:
|
||||
- MYSQL_ROOT_PASSWORD=alpine
|
||||
- MYSQL_PASSWORD=alpine
|
||||
- MYSQL_USER=kanel
|
||||
- MYSQL_DATABASE=knl
|
||||
- MYSQL_ROOT_PASSWORD_FILE=/run/secrets/root-db-pass
|
||||
- MYSQL_PASSWORD_FILE=/run/secrets/user-db-pass
|
||||
- MYSQL_USER=${DB_USER}
|
||||
- MYSQL_DATABASE=${DB_NAME}
|
||||
volumes:
|
||||
- wp-db:/var/lib/mysql
|
||||
secrets:
|
||||
@ -196,7 +196,7 @@ services:
|
||||
volumes:
|
||||
- wp-site:/var/ftp
|
||||
ports:
|
||||
- 2100:21
|
||||
- 21:21
|
||||
- 30000-30100:30000-30100
|
||||
secrets:
|
||||
- ftp-pass
|
||||
|
@ -27,7 +27,7 @@ EXPOSE 21
|
||||
EXPOSE 30000-30100
|
||||
|
||||
VOLUME /var/ftp
|
||||
STOPSIGNAL SIGTERM
|
||||
STOPSIGNAL SIGKILL
|
||||
|
||||
ENTRYPOINT [ "/docker-entrypoint" ]
|
||||
|
||||
|
@ -11,7 +11,8 @@ COPY internal /build/internal
|
||||
|
||||
RUN cd /build \
|
||||
&& 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
|
||||
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/healthcheck /docker-healthcheck
|
||||
COPY --from=builder /build/getFileEnv /bin/getFileEnv
|
||||
|
||||
RUN apk add --no-cache mariadb tzdata mariadb-client \
|
||||
&& chmod +x /docker-healthcheck \
|
||||
|
4
srcs/internal/env/env_util.go
vendored
4
srcs/internal/env/env_util.go
vendored
@ -7,6 +7,10 @@ import (
|
||||
"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
|
||||
func FileEnv(Value, Default string) string {
|
||||
val, is := os.LookupEnv(Value)
|
||||
|
Reference in New Issue
Block a user