Skip to content

Commit

Permalink
So long docker-compose. Welcome docker compose.
Browse files Browse the repository at this point in the history
Signed-off-by: Eric Pugh <epugh@opensourceconnections.com>
  • Loading branch information
epugh committed Sep 19, 2024
1 parent bc9ce71 commit da8793c
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 18 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ bin/docker server
It can take up to a minute for the server to respond as it compiles all the front end assets on the first call.

We've created a helper script to run and manage the app through docker that wraps around the `docker-compose` command. You will need Ruby installed.
You can still use `docker-compose` directly, but for the basic stuff you can use the following:
You can still use `docker compose` directly, but for the basic stuff you can use the following:

* Start the app: `bin/docker server` or `bin/docker s`
* Connect to the app container with bash: `bin/docker bash` or `bin/docker ba`
Expand Down Expand Up @@ -454,17 +454,17 @@ docker tag o19s/quepid o19s/quepid:$QUEPID_VERSION

- Bring up the mysql container
```
docker-compose up -d mysql
docker compose up -d mysql
```
- Run the initialization scripts. This can take a few seconds
```
docker-compose run --rm app bin/rake db:setup
docker compose run --rm app bin/rake db:setup
```
- Update your docker-compose.prod.yml file to use your image by updating the image version in the app ```image: o19s/quepid:10.0.0```

- Start up the app either as a Daemon (-d) or as an active container
```
docker-compose up [-d]
docker compose up [-d]
```
- You should be able to access the app through [http://localhost](http://localhost)

Expand Down
14 changes: 7 additions & 7 deletions bin/docker
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ command, *rest = ARGV
Dir.chdir APP_ROOT do
case command
when 'server', 's'
system 'docker-compose up --no-deps -d nginx'
system 'docker-compose run --rm --service-ports app foreman s -f Procfile.dev'
system 'docker compose up --no-deps -d nginx'
system 'docker compose run --rm --service-ports app foreman s -f Procfile.dev'
when 'bash', 'b'
system 'docker-compose run --rm app bash'
system 'docker compose run --rm app bash'
when 'console', 'c'
system 'docker-compose run --rm app rails console ' # add -e test for test environment
system 'docker compose run --rm app rails console ' # add -e test for test environment
when 'run', 'r'
system "docker-compose run --rm app #{rest.shelljoin()}"
system "docker compose run --rm app #{rest.shelljoin()}"
when 'daemon', 'q'
system 'docker-compose run -d --service-ports app foreman s -f Procfile.dev'
system 'docker compose run -d --service-ports app foreman s -f Procfile.dev'
when 'destroy', 'd'
system 'docker-compose down'
system 'docker compose down'
else
puts 'Unknown option (bash|b, console|c, run|r, server|s, daemon|q, destroy|d)'
end
Expand Down
6 changes: 3 additions & 3 deletions bin/setup_docker
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Dir.chdir APP_ROOT do
# Add necessary setup steps to this file:

puts "\n== Teardown Existing Quepid =="
system "docker-compose down -v"
system "docker compose down -v"

puts "\n== Copying sample files =="
unless File.exist?("config/database.yml")
Expand All @@ -25,11 +25,11 @@ Dir.chdir APP_ROOT do
if ARGV.length > 0 and ARGV[0] == "nobuild"
build_arg = "--no-build"
puts "\n== Pulling latest image =="
system "docker-compose pull app"
system "docker compose pull app"
end

puts "\n== Building Docker container =="
system "docker-compose up #{build_arg} --no-start"
system "docker compose up #{build_arg} --no-start"

system "bin/docker r yarn"
system "bin/docker r ./wait-for mysql:3306 --timeout=60 -- bin/rake db:setup"
Expand Down
1 change: 0 additions & 1 deletion docker-compose.prod.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Docker Compose file for running Quepid in Production mode.
# Allows you to update your Quepid installation over time.

version: '3'
services:
mysql:
container_name: quepid_prod_db
Expand Down
3 changes: 1 addition & 2 deletions docs/docker_images.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
Images for the main app are maintained on Docker Hub. To push a new build:

- Login: `docker login` (Requires access to the quepid account)
- Push: `docker-compose push`
- Push: `docker compose push`

To tag specific versions add a tag in the docker-compose file, to get started we're defaulting to latest.

2 changes: 1 addition & 1 deletion keycloak/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM quay.io/keycloak/keycloak:24.0.5 as builder
FROM quay.io/keycloak/keycloak:24.0.5 AS builder

# Enable health and metrics support
ENV KC_HEALTH_ENABLED=true
Expand Down

0 comments on commit da8793c

Please sign in to comment.