From ea923e3c957660e354685fea7a72a6ab5c7b6363 Mon Sep 17 00:00:00 2001 From: Emilio Alvarez Date: Fri, 27 Jan 2023 10:54:43 -0600 Subject: [PATCH] update compose down (#1904) --- .devcontainer/devcontainer.json | 6 +++--- .devcontainer/docker-compose.extend.yml | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 502f002147..3ef07f8b44 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -17,16 +17,16 @@ "workspaceFolder": "/home/node/workspace", // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [], + // "forwardPorts": ["dev:80"], // Uncomment the next line if you want start specific services in your Docker Compose config. // "runServices": [], // Uncomment the next line if you want to keep your containers running after VS Code shuts down. - // "shutdownAction": "none", + "shutdownAction": "stopCompose", // Uncomment the next line to run commands after the container is created - for example installing curl. - "initializeCommand": "docker compose down", + "initializeCommand": "docker compose -f docker-compose.yml -f .devcontainer/docker-compose.extend.yml down", "postCreateCommand": "npm install --omit=optional", "postStartCommand": "npx snowpack dev", diff --git a/.devcontainer/docker-compose.extend.yml b/.devcontainer/docker-compose.extend.yml index b544f7a2ae..50fd1b4265 100644 --- a/.devcontainer/docker-compose.extend.yml +++ b/.devcontainer/docker-compose.extend.yml @@ -1,7 +1,7 @@ # version: '3.9' services: dev: - # Do we need auth sock? + # Do we need auth sock? # If you want add a non-root user to your Dockerfile, you can use the "remoteUser" # property in devcontainer.json to cause VS Code its sub-processes (terminals, tasks, # debugging) to execute as the user. Uncomment the next line if you want the entire @@ -37,6 +37,7 @@ services: - SYS_PTRACE security_opt: - seccomp:unconfined + restart: on-failure # Overrides default command so things don't shut down after the process ends. command: /bin/sh -c "while sleep 1000; do :; done" php: @@ -45,6 +46,7 @@ services: - ./src/Media:/usr/local/apache2/htdocs/media - ./cypress_php/api:/usr/local/apache2/htdocs/cyapi - vendor:/usr/local/apache2/htdocs/api/vendor + restart: on-failure apache: volumes: - ./dist:/usr/local/apache2/htdocs/ @@ -58,6 +60,7 @@ services: volumes: - ./doenet_docker/volumes/db:/var/lib/mysql - ./doenet_docker/volumes/db_init:/docker-entrypoint-initdb.d + restart: on-failure # for realtime testing # rtnode: