Skip to content

Commit

Permalink
chore: bring docker-compose to root level (#3642) (#3643)
Browse files Browse the repository at this point in the history
Authored-by: Nicolas Giard <github@ngpixel.com>
  • Loading branch information
rjsparks authored Mar 14, 2022
1 parent 86a3895 commit aa718e7
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// https://github.com/microsoft/vscode-dev-containers/tree/v0.202.5/containers/python-3
{
"name": "IETF Datatracker",
"dockerComposeFile": ["../docker/docker-compose.yml", "docker-compose.extend.yml"],
"dockerComposeFile": ["../docker-compose.yml", "docker-compose.extend.yml"],
"service": "app",
"workspaceFolder": "/root/src",
"shutdownAction": "stopCompose",
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/docker-compose.extend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ services:
EDITOR_VSCODE: 1
DJANGO_SETTINGS_MODULE: settings_local_sqlitetest
volumes:
- ..:/root/src
- .:/root/src
- /root/src/node_modules
# Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function.
network_mode: service:db
2 changes: 1 addition & 1 deletion docker/docker-compose.yml → docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: '3.8'
services:
app:
build:
context: ..
context: .
dockerfile: docker/app.Dockerfile
args:
# Update 'VARIANT' to pick a version of Python: 3, 3.10, 3.9, 3.8, 3.7, 3.6
Expand Down
2 changes: 2 additions & 0 deletions docker/cleanall
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#!/bin/bash

cd ..
echo "Shutting down any instance still running and purge images..."
docker-compose down -v --rmi all
echo "Purging dangling images..."
docker image prune
cd docker
echo "Done!"
2 changes: 2 additions & 0 deletions docker/cleandb
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#!/bin/bash

echo "Shutting down any instance still running..."
cd ..
docker-compose down -v
echo "Rebuilding the DB image..."
docker-compose pull db
docker-compose build --no-cache db
cd docker
echo "Done!"
2 changes: 1 addition & 1 deletion docker/docker-compose.extend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ services:
ports:
- '8000:8000'
volumes:
- ..:/root/src
- .:/root/src
- /root/src/node_modules
db:
ports:
Expand Down
4 changes: 3 additions & 1 deletion docker/run
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

docker-compose -f docker-compose.yml -f docker-compose.extend.yml up -d
cd ..
docker-compose -f docker-compose.yml -f docker/docker-compose.extend.yml up -d
docker-compose exec app /bin/sh /docker-init.sh
docker-compose down
cd docker

0 comments on commit aa718e7

Please sign in to comment.