diff --git a/.gitignore b/.gitignore index 6bbdf9d..991f3c2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ .idea/ wordpress.iml +data/ build/patch-util/wp-src/ build/tests-util/composer.lock build/tests-util/vendor/ diff --git a/Dockerfile.dev b/Dockerfile.dev new file mode 100644 index 0000000..4ef46f5 --- /dev/null +++ b/Dockerfile.dev @@ -0,0 +1,19 @@ +ARG WP_VERSION=6.5.3 +FROM scratch AS rootfs + +# Install composer +COPY --from=composer:2.7 ["/usr/bin/composer", "/usr/local/bin/composer"] + + + +ARG WP_VERSION +FROM ghcr.io/n0rthernl1ghts/wordpress:${WP_VERSION} + +RUN set -eux \ + && apk add --update --no-cache exa file fish git less nano openssh-client rsync tree unzip wget + +COPY --from=rootfs ["/", "/"] + + +WORKDIR "/workspace" +ENTRYPOINT ["/usr/bin/fish"] diff --git a/bin/dev-shell b/bin/dev-shell new file mode 100755 index 0000000..ba296fa --- /dev/null +++ b/bin/dev-shell @@ -0,0 +1,24 @@ +#!/usr/bin/env bash + + + +# This is development util +main() { + local wpVersion="${1:-6.5.3}" + + set -ex + + docker build \ + --file=Dockerfile.dev \ + --build-arg="WP_VERSION=${wpVersion}" \ + -t "localhost/nlss-wp-dev:${wpVersion}" . + + docker run \ + --init \ + --rm \ + -it \ + -v "${PWD}/src/:/workspace" \ + "localhost/nlss-wp-dev:${wpVersion}" +} + +main "${@}" diff --git a/bin/shell b/bin/shell deleted file mode 100755 index 0002ab8..0000000 --- a/bin/shell +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env bash - -# This is development util -main() { - local wpVersion="${1:-latest}" - docker run \ - --init \ - --entrypoint="/bin/bash" \ - --workdir="/app" \ - --rm \ - -it \ - -v "${PWD}/src/init-utils:/app" \ - "ghcr.io/n0rthernl1ghts/wordpress:${wpVersion}" -} - -main "${@}"