Merge pull request 'Update docker compose commands to Compose V2' (#570) from norm/akkoma:docker-compose into develop
ci/woodpecker/push/woodpecker Pipeline is pending Details

Reviewed-on: #570
This commit is contained in:
floatingghost 2023-06-26 12:37:38 +00:00
commit 145191ef26
4 changed files with 20 additions and 20 deletions

View File

@ -1,4 +1,4 @@
#!/bin/sh #!/bin/sh
docker-compose build --build-arg UID=$(id -u) --build-arg GID=$(id -g) akkoma docker compose build --build-arg UID=$(id -u) --build-arg GID=$(id -g) akkoma
docker-compose build --build-arg UID=$(id -u) --build-arg GID=$(id -g) db docker compose build --build-arg UID=$(id -u) --build-arg GID=$(id -g) db

View File

@ -1,3 +1,3 @@
#!/bin/sh #!/bin/sh
docker-compose run --rm akkoma $@ docker compose run --rm akkoma $@

View File

@ -10,7 +10,7 @@ If you want to migrate from or OTP to docker, check out [the migration guide](./
### Prepare the system ### Prepare the system
* Install docker and docker-compose * Install docker and docker compose
* [Docker](https://docs.docker.com/engine/install/) * [Docker](https://docs.docker.com/engine/install/)
* [Docker-compose](https://docs.docker.com/compose/install/) * [Docker-compose](https://docs.docker.com/compose/install/)
* This will usually just be a repository installation and a package manager invocation. * This will usually just be a repository installation and a package manager invocation.
@ -26,7 +26,7 @@ echo "DOCKER_USER=$(id -u):$(id -g)" >> .env
``` ```
This probably won't need to be changed, it's only there to set basic environment This probably won't need to be changed, it's only there to set basic environment
variables for the docker-compose file. variables for the docker compose file.
### Building the container ### Building the container
@ -65,9 +65,9 @@ cp config/generated_config.exs config/prod.secret.exs
We need to run a few commands on the database container, this isn't too bad We need to run a few commands on the database container, this isn't too bad
```bash ```bash
docker-compose run --rm --user akkoma -d db docker compose run --rm --user akkoma -d db
# Note down the name it gives here, it will be something like akkoma_db_run # Note down the name it gives here, it will be something like akkoma_db_run
docker-compose run --rm akkoma psql -h db -U akkoma -f config/setup_db.psql docker compose run --rm akkoma psql -h db -U akkoma -f config/setup_db.psql
docker stop akkoma_db_run # Replace with the name you noted down docker stop akkoma_db_run # Replace with the name you noted down
``` ```
@ -84,17 +84,17 @@ We're going to run it in the foreground on the first run, just to make sure
everything start up. everything start up.
```bash ```bash
docker-compose up docker compose up
``` ```
If everything went well, you should be able to access your instance at http://localhost:4000 If everything went well, you should be able to access your instance at http://localhost:4000
You can `ctrl-c` out of the docker-compose now to shutdown the server. You can `ctrl-c` out of the docker compose now to shutdown the server.
### Running in the background ### Running in the background
```bash ```bash
docker-compose up -d docker compose up -d
``` ```
### Create your first user ### Create your first user
@ -125,8 +125,8 @@ cp docker-resources/Caddyfile.example docker-resources/Caddyfile
Then edit the TLD in your caddyfile to the domain you're serving on. Then edit the TLD in your caddyfile to the domain you're serving on.
Uncomment the `caddy` section in the docker-compose file, Uncomment the `caddy` section in the docker compose file,
then run `docker-compose up -d` again. then run `docker compose up -d` again.
#### Running a reverse proxy on the host #### Running a reverse proxy on the host
@ -152,7 +152,7 @@ git pull
./docker-resources/manage.sh mix deps.get ./docker-resources/manage.sh mix deps.get
./docker-resources/manage.sh mix compile ./docker-resources/manage.sh mix compile
./docker-resources/manage.sh mix ecto.migrate ./docker-resources/manage.sh mix ecto.migrate
docker-compose restart akkoma db docker compose restart akkoma db
``` ```
#### Further reading #### Further reading

View File

@ -10,7 +10,7 @@ You probably should, in the first instance.
### Prepare the system ### Prepare the system
* Install docker and docker-compose * Install docker and docker compose
* [Docker](https://docs.docker.com/engine/install/) * [Docker](https://docs.docker.com/engine/install/)
* [Docker-compose](https://docs.docker.com/compose/install/) * [Docker-compose](https://docs.docker.com/compose/install/)
* This will usually just be a repository installation and a package manager invocation. * This will usually just be a repository installation and a package manager invocation.
@ -46,7 +46,7 @@ For *most* from-source installs it'll already be there.
And the same with `uploads`, make sure your uploads (if you have them on disk) are And the same with `uploads`, make sure your uploads (if you have them on disk) are
located at `uploads/` in the akkoma source directory. located at `uploads/` in the akkoma source directory.
If you have them on a different disk, you will need to mount that disk into the docker-compose file, If you have them on a different disk, you will need to mount that disk into the docker compose file,
with an entry that looks like this: with an entry that looks like this:
```yaml ```yaml
@ -66,7 +66,7 @@ echo "DOCKER_USER=$(id -u):$(id -g)" >> .env
``` ```
This probably won't need to be changed, it's only there to set basic environment This probably won't need to be changed, it's only there to set basic environment
variables for the docker-compose file. variables for the docker compose file.
=== "From source" === "From source"
@ -126,21 +126,21 @@ mkdir pgdata
Now we can import our database to the container. Now we can import our database to the container.
```bash ```bash
docker-compose run --rm --user akkoma -d db docker compose run --rm --user akkoma -d db
docker-compose run --rm akkoma pg_restore -v -U akkoma -j $(grep -c ^processor /proc/cpuinfo) -d akkoma -h db akkoma_backup.sql docker compose run --rm akkoma pg_restore -v -U akkoma -j $(grep -c ^processor /proc/cpuinfo) -d akkoma -h db akkoma_backup.sql
``` ```
### Reverse proxies ### Reverse proxies
If you're just reusing your old proxy, you may have to uncomment the line in If you're just reusing your old proxy, you may have to uncomment the line in
the docker-compose file under `ports`. You'll find it. the docker compose file under `ports`. You'll find it.
Otherwise, you can use the same setup as the [docker installation guide](./docker_en.md#reverse-proxies). Otherwise, you can use the same setup as the [docker installation guide](./docker_en.md#reverse-proxies).
### Let's go ### Let's go
```bash ```bash
docker-compose up -d docker compose up -d
``` ```
You should now be at the same point as you were before, but with a docker install. You should now be at the same point as you were before, but with a docker install.