[Docker] Start only a single service for the devcontainer

Doesn't pull the other stuff in which greatly increases startup performance and reliability
This commit is contained in:
Earlopain 2024-01-14 18:36:16 +01:00
parent 2de0ebb5b8
commit 10156208ac
No known key found for this signature in database
GPG Key ID: 48860312319ADF61
3 changed files with 47 additions and 4 deletions

View File

@ -1,7 +1,8 @@
{
"name": "E621ng project development",
"dockerComposeFile": "../docker-compose.yml",
"service": "e621",
"dockerComposeFile": ["../docker-compose.yml", "docker-compose.extend.yml"],
"service": "dev-container",
"overrideCommand": true,
"workspaceFolder": "/app",
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {}

View File

@ -0,0 +1,42 @@
version: "3"
services:
# Dev Container extension doesn't support `depends_on: !reset []`
# https://github.com/microsoft/vscode-remote-release/issues/8734
dev-container:
image: e621
environment:
RAILS_ENV: development
volumes:
- .:/app
- ./docker/danbooru_local_config.rb:/app/config/danbooru_local_config.rb
- node_modules:/app/node_modules
# Don't start any other services
e621:
profiles:
- dev-container
autocompleted:
profiles:
- dev-container
nginx:
profiles:
- dev-container
postgres:
profiles:
- dev-container
redis:
profiles:
- dev-container
memcached:
profiles:
- dev-container
opensearch:
profiles:
- dev-container
iqdb:
profiles:
- dev-container
discord_joiner:
profiles:
- dev-container

View File

@ -45,9 +45,9 @@ You're most likely using Windows. Give this a shot, it tells Git to stop trackin
#### <a id="development-tools"></a>Things to aid you during development
`bin/rails tests` to execute the test suite.
`docker compose run --rm tests` to execute the test suite.
`bundle exec rubocop` to run the linter.
`docker compose run --rm rubocop` to run the linter.
The postgres server accepts outside connections which you can use to access it with a local client. Use `localhost:34517` to connect to a database named `e621_development` with the user `e621`. Leave the password blank, anything will work.