Skip to content

Commit

Permalink
update cd.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelreit committed Aug 9, 2024
1 parent c3cce4e commit 1e607bf
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,5 +85,4 @@ jobs:
docker compose down
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
docker compose up -d
rm docker-compose.yml
rm -rf src/
# docker compose down -v | -v removes all volumes as well
6 changes: 6 additions & 0 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,12 @@ $ docker run --detach -p 8080:8080 wildfly
----
#Pull repository
$ git pull https://github.com/marcel-gepardec/api-demo.git
#Replace configuration for mysql database in the file docker-compose.yml
environment: # Set Passwords, User and Database
MYSQL_ROOT_PASSWORD: password # Set the root password for MySQL
MYSQL_DATABASE: ApiDemo # Create a database named 'ApiDemo'
MYSQL_USER: DB_USER_NAME # Create a user with the specified username
MYSQL_PASSWORD: DB_USER_PASSWORD # Set the password for the user
#Run docker compose file
$ docker compose up -d
----
8 changes: 4 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@ services:
networks:
- api-demo-network
ports:
- "8080:8080" # Map port 80 in the container to port 8080 on the host (adjust as needed)
- "8080:8080"

db:
image: mysql:8.1.0
networks:
- api-demo-network
ports:
- "3306:3306" # Map port 80 in the container to port 8080 on the host (adjust as needed)
environment:
- "3306:3306"
environment: # Set Passwords, User and Database
MYSQL_ROOT_PASSWORD: password # Set the root password for MySQL
MYSQL_DATABASE: ApiDemo # Create a database named 'ApiDemo'
MYSQL_USER: DB_USER_NAME # Create a user with the specified username
MYSQL_PASSWORD: DB_USER_PASSWORD # Set the password for the user
volumes:
- db_data:/var/lib/mysql # Persist MySQL data
- ./src/main/resources/db/migration/V0_9_0__initial_db_creation.sql:/docker-entrypoint-initdb.d/init.sql # Mount the SQL script
- ./src/main/resources/db/migration/V0_9_0__initial_db_creation.sql:/docker-entrypoint-initdb.d/init.sql # Mount the initial SQL script

networks:
api-demo-network:
Expand Down

0 comments on commit 1e607bf

Please sign in to comment.