Skip to content

Commit

Permalink
Point to certs directory instead of copying
Browse files Browse the repository at this point in the history
  • Loading branch information
ngan committed Apr 8, 2024
1 parent 14e7dbc commit 3ce209a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
3 changes: 3 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ services:
- --gtid-mode=ON
- --enforce-gtid-consistency=ON
- --log-bin=mysql-bin.log
- --ssl-ca=/mysql-certs/ca.pem
- --ssl-cert=/mysql-certs/server-cert.pem
- --ssl-key=/mysql-certs/server-key.pem
build:
context: .
dockerfile: Dockerfile.mysql
Expand Down
7 changes: 1 addition & 6 deletions docker-entrypoint-initdb.d/generate_keys.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -euo pipefail

cd /var/lib/mysql
cd /mysql-certs

# Generate a CA to test with

Expand Down Expand Up @@ -53,8 +53,3 @@ openssl x509 -req -sha256 -CA ca.pem -CAkey ca-key.pem -set_serial 2 \
-days 365 \
-in client-csr.pem \
-out client-cert.pem

# Copy the certificates to the shared directory so that it's accessible from the app
# container.

cp /var/lib/mysql/*.pem /mysql-certs
1 change: 1 addition & 0 deletions script/cibuild
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ output_fold() {
function cleanup() {
echo
echo "::group::Shutting down services..."
docker compose logs db
docker compose down --volumes
echo "::endgroup::"
}
Expand Down

0 comments on commit 3ce209a

Please sign in to comment.