mirror of
https://github.com/Ninjaclasher/dmoj-docker.git
synced 2024-11-25 16:36:31 +08:00
Migrate to docker compose v2
This commit is contained in:
parent
4fcc7dfa05
commit
747249e12a
4
.github/workflows/docker.yml
vendored
4
.github/workflows/docker.yml
vendored
@ -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
|
||||
|
10
README.md
10
README.md
@ -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
|
||||
|
@ -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 && \
|
||||
|
@ -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
|
||||
|
@ -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 $@
|
||||
|
@ -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 $@
|
||||
|
Loading…
Reference in New Issue
Block a user