about summary refs log tree commit diff
path: root/.devcontainer
diff options
context:
space:
mode:
authorRobert R George <rgeorge@midnightweb.net>2023-03-29 04:27:19 -0700
committerGitHub <noreply@github.com>2023-03-29 13:27:19 +0200
commitcb9cc09a6dc1acb3c8b1b353d395b0aa73491c83 (patch)
tree1a0370347703b2e36de25a26784564df9b3e290d /.devcontainer
parentc855e1ecbcc5dd918492cc688a88e74eb52e9b91 (diff)
Fixes launching of the devcontainer and adds support for Docker Desktop (#24303)
Diffstat (limited to '.devcontainer')
-rw-r--r--.devcontainer/devcontainer.json1
-rw-r--r--.devcontainer/docker-compose.yml12
-rwxr-xr-x.devcontainer/post-create.sh3
3 files changed, 14 insertions, 2 deletions
diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json
index d628fd1bd..17208a84e 100644
--- a/.devcontainer/devcontainer.json
+++ b/.devcontainer/devcontainer.json
@@ -15,6 +15,7 @@
   "forwardPorts": [3000, 4000],
 
   // Use 'postCreateCommand' to run commands after the container is created.
+  "onCreateCommand": "git config --global --add safe.directory ${containerWorkspaceFolder}",
   "postCreateCommand": ".devcontainer/post-create.sh",
   "waitFor": "postCreateCommand",
 
diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml
index 1b1756eca..73fe22f3a 100644
--- a/.devcontainer/docker-compose.yml
+++ b/.devcontainer/docker-compose.yml
@@ -10,7 +10,7 @@ services:
     environment:
       RAILS_ENV: development
       NODE_ENV: development
-
+      BIND: 0.0.0.0
       REDIS_HOST: redis
       REDIS_PORT: '6379'
       DB_HOST: db
@@ -23,6 +23,10 @@ services:
       LIBRE_TRANSLATE_ENDPOINT: http://libretranslate:5000
     # Overrides default command so things don't shut down after the process ends.
     command: sleep infinity
+    ports:
+      - '127.0.0.1:3000:3000'
+      - '127.0.0.1:4000:4000'
+      - '127.0.0.1:80:3000'
     networks:
       - external_network
       - internal_network
@@ -66,15 +70,19 @@ services:
         hard: -1
 
   libretranslate:
-    image: libretranslate/libretranslate:v1.2.9
+    image: libretranslate/libretranslate:v1.3.10
     restart: unless-stopped
+    volumes:
+      - lt-data:/home/libretranslate/.local
     networks:
+      - external_network
       - internal_network
 
 volumes:
   postgres-data:
   redis-data:
   es-data:
+  lt-data:
 
 networks:
   external_network:
diff --git a/.devcontainer/post-create.sh b/.devcontainer/post-create.sh
index 02f488f12..7c3852e7e 100755
--- a/.devcontainer/post-create.sh
+++ b/.devcontainer/post-create.sh
@@ -14,6 +14,9 @@ git checkout -- Gemfile.lock
 # [re]create, migrate, and seed the test database
 RAILS_ENV=test ./bin/rails db:setup
 
+# [re]create, migrate, and seed the development database
+RAILS_ENV=development ./bin/rails db:setup
+
 # Precompile assets for development
 RAILS_ENV=development ./bin/rails assets:precompile