diff --git a/.devcontainer/README.md b/.devcontainer/README.md index 7c7d88c187..9c80f24482 100644 --- a/.devcontainer/README.md +++ b/.devcontainer/README.md @@ -5,13 +5,13 @@ This file contains the configuration for the dev container. It is used to define There are three main components that the devcontainer.json file relies on: - The docker compose file (`.devcontainer/compose.yml`), which defines all the services that should be started when the dev container is launched, like MySQL and Redis. -- The Dockerfile (`.devcontainer/Dockerfile`), which is used to build the dev container image. +- The Dockerfile (`.docker/Dockerfile`), which is used to build the dev container image. - The `onCreateCommand` script (`.devcontainer/onCreateCommand.js`), which is used to setup the dev container after it is created. The Dev Container setup is intended to be as simple as possible with a focus on a really simple setup experience. It is designed to use VSCode's "Clone Repository in Container" feature, which will automatically handle the setup of the dev container, and create a volume for the Ghost codebase that is managed by Docker. It is a great tool for quickly spinning up an isolated development environment, but it lacks some of the flexibility and direct control that a full docker compose setup can provide. Therefore, if you plan to do more "heavy lifting" on Ghost, we recommend using the docker compose setup instead. ## Dockerfile -The Dockerfile used to build the Dev Container itself is located at `.devcontainer/Dockerfile`. This Dockerfile uses a multi-stage build to allow for multiple types of builds without duplicating code and ensuring maximum consistency. The following targets are available: +The Dockerfile used to build the Dev Container itself is located at `.docker/Dockerfile`. This Dockerfile uses a multi-stage build to allow for multiple types of builds without duplicating code and ensuring maximum consistency. The following targets are available: - `base`: The bare minimum base image used to build and run Ghost. Includes the operating system, node, and some build dependencies, but does not include any Ghost code or dependencies. - `base-devcontainer`: everything from `base`, plus additional development dependencies like the stripe-cli and playwright. No code or node dependencies. - `full-devcontainer`: everything from `base-devcontainer`, plus Ghost's code and all node dependencies diff --git a/.devcontainer/compose.yml b/.devcontainer/compose.yml index ab36bbc86b..a345459fc8 100644 --- a/.devcontainer/compose.yml +++ b/.devcontainer/compose.yml @@ -9,7 +9,7 @@ services: command: ["sleep", "infinity"] build: context: ../ - dockerfile: .devcontainer/Dockerfile + dockerfile: .docker/Dockerfile target: base-devcontainer pull_policy: never environment: diff --git a/.devcontainer/Dockerfile b/.docker/Dockerfile similarity index 100% rename from .devcontainer/Dockerfile rename to .docker/Dockerfile diff --git a/.github/scripts/grafana/dashboard.yml b/.docker/grafana/dashboard.yml similarity index 100% rename from .github/scripts/grafana/dashboard.yml rename to .docker/grafana/dashboard.yml diff --git a/.github/scripts/grafana/dashboards/main-dashboard.json b/.docker/grafana/dashboards/main-dashboard.json similarity index 100% rename from .github/scripts/grafana/dashboards/main-dashboard.json rename to .docker/grafana/dashboards/main-dashboard.json diff --git a/.github/scripts/grafana/datasources/datasource.yml b/.docker/grafana/datasources/datasource.yml similarity index 100% rename from .github/scripts/grafana/datasources/datasource.yml rename to .docker/grafana/datasources/datasource.yml diff --git a/.github/scripts/mysql-preload/.keep b/.docker/mysql-preload/.keep similarity index 100% rename from .github/scripts/mysql-preload/.keep rename to .docker/mysql-preload/.keep diff --git a/.github/scripts/prometheus/prometheus.yml b/.docker/prometheus/prometheus.yml similarity index 100% rename from .github/scripts/prometheus/prometheus.yml rename to .docker/prometheus/prometheus.yml diff --git a/.github/scripts/docker-compose.yml b/compose.yml similarity index 79% rename from .github/scripts/docker-compose.yml rename to compose.yml index 1f61ef3958..f3292578ac 100644 --- a/.github/scripts/docker-compose.yml +++ b/compose.yml @@ -14,7 +14,7 @@ services: restart: always volumes: # Turns out you can drop .sql or .sql.gz files in here, cool! - - ./mysql-preload:/docker-entrypoint-initdb.d + - ./.docker/mysql-preload:/docker-entrypoint-initdb.d - mysql-data:/var/lib/mysql healthcheck: test: "mysql -uroot -proot ghost -e 'select 1'" @@ -34,7 +34,7 @@ services: - "9090:9090" restart: always volumes: - - ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml + - ./.docker/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml grafana: profiles: [monitoring] image: grafana/grafana:8.3.0 @@ -46,9 +46,9 @@ services: - GF_AUTH_ANONYMOUS_ENABLED=true - GF_AUTH_ANONYMOUS_ORG_ROLE=Admin volumes: - - ./grafana/datasources:/etc/grafana/provisioning/datasources - - ./grafana/dashboard.yml:/etc/grafana/provisioning/dashboards/main.yaml - - ./grafana/dashboards:/var/lib/grafana/dashboards + - ./.docker/grafana/datasources:/etc/grafana/provisioning/datasources + - ./.docker/grafana/dashboard.yml:/etc/grafana/provisioning/dashboards/main.yaml + - ./.docker/grafana/dashboards:/var/lib/grafana/dashboards pushgateway: profiles: [monitoring] image: prom/pushgateway:v1.6.0 diff --git a/package.json b/package.json index df765a4973..83461cef6b 100644 --- a/package.json +++ b/package.json @@ -34,9 +34,9 @@ "reset:data": "cd ghost/core && node index.js generate-data --clear-database --quantities members:100000,posts:500 --seed 123", "reset:data:empty": "cd ghost/core && node index.js generate-data --clear-database --quantities members:0,posts:0 --seed 123", "reset:data:xxl": "cd ghost/core && node index.js generate-data --clear-database --quantities members:2000000,posts:0,emails:0,members_stripe_customers:0,members_login_events:0,members_status_events:0 --seed 123", - "docker:reset": "docker-compose -f .github/scripts/docker-compose.yml down -v && docker-compose -f .github/scripts/docker-compose.yml up -d --wait", - "docker:down": "docker-compose -f .github/scripts/docker-compose.yml down", - "compose": "docker compose -f .devcontainer/.docker/base.compose.yml -f .devcontainer/.docker/development.compose.yml", + "docker:reset": "docker compose down -v && docker compose up -d --wait", + "docker:down": "docker compose down", + "compose": "docker compose -f .devcontainer/compose.yml", "lint": "nx run-many -t lint", "test": "nx run-many -t test", "test:unit": "nx run-many -t test:unit",