Migrate to docker compose v2

This commit is contained in:
Evan 2024-05-04 20:31:56 -04:00
parent 4fcc7dfa05
commit 747249e12a
No known key found for this signature in database
GPG Key ID: 876F598B31E92DAC
6 changed files with 11 additions and 11 deletions

View File

@ -13,12 +13,12 @@ jobs:
run: |
git submodule update --init --recursive
- name: Build images
run: docker-compose build
run: docker compose build
working-directory: dmoj
- name: Test images
run: |
./scripts/initialize
docker-compose up -d
docker compose up -d
sleep 10
COMPOSE_EXEC_FLAGS="-T" ./scripts/copy_static
COMPOSE_EXEC_FLAGS="-T" ./scripts/migrate

View File

@ -25,12 +25,12 @@ Configure the environment variables in the files in `dmoj/environment/`. In part
Next, build the images:
```sh
$ docker-compose build
$ docker compose build
```
Start up the site, so you can perform the initial migrations and generate the static files:
```sh
$ docker-compose up -d site
$ docker compose up -d site
```
You will need to generate the schema for the database, since it is currently empty:
@ -52,7 +52,7 @@ $ ./scripts/manage.py loaddata demo
## Usage
```
$ docker-compose up -d
$ docker compose up -d
```
## Notes
@ -74,13 +74,13 @@ Updating various sections of the site requires different images to be rebuilt.
If any prerequisites were modified, you will need to rebuild most of the images:
```sh
$ docker-compose up -d --build base site celery bridged wsevent
$ docker compose up -d --build base site celery bridged wsevent
```
If the static files are modified, read the section on [Managing Static Files](#managing-static-files).
If only the source code is modified, a restart is sufficient:
```sh
$ docker-compose restart site celery bridged wsevent
$ docker compose restart site celery bridged wsevent
```
### Multiple Nginx Instances

View File

@ -1,7 +1,7 @@
#!/bin/bash
cd $(dirname $(dirname $0)) || exit
docker-compose exec $COMPOSE_EXEC_FLAGS site /bin/bash -c "\
docker compose exec $COMPOSE_EXEC_FLAGS site /bin/bash -c "\
bash make_style.sh && \
python3 manage.py collectstatic --noinput && \
python3 manage.py compilemessages && \

View File

@ -1,4 +1,4 @@
#!/bin/bash
cd $(dirname $(dirname $0)) || exit
docker-compose exec $COMPOSE_EXEC_FLAGS site /bin/bash
docker compose exec $COMPOSE_EXEC_FLAGS site /bin/bash

View File

@ -1,4 +1,4 @@
#!/bin/bash
cd $(dirname $(dirname $0)) || exit
docker-compose exec $COMPOSE_EXEC_FLAGS site python3 manage.py $@
docker compose exec $COMPOSE_EXEC_FLAGS site python3 manage.py $@

View File

@ -1,4 +1,4 @@
#!/bin/bash
cd $(dirname $(dirname $0)) || exit
docker-compose exec $COMPOSE_EXEC_FLAGS site python3 manage.py migrate $@
docker compose exec $COMPOSE_EXEC_FLAGS site python3 manage.py migrate $@