Skip to content

Commit

Permalink
9/11: testing
Browse files Browse the repository at this point in the history
  • Loading branch information
thuan committed Nov 11, 2023
1 parent da9fcea commit 19ddc12
Show file tree
Hide file tree
Showing 5 changed files with 91 additions and 2 deletions.
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM openjdk:17-alpine
ARG JAR_FILE=target/*.jar
COPY ${JAR_FILE} app.jar
ENTRYPOINT ["java","-jar","/app.jar"]
37 changes: 37 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
version: '3.8'

services:
mysql:
container_name: mysqldb
image: mysql
restart: always
ports:
- "3305:3306"
environment:
- MYSQL_ROOT_PASSWORD=1234
- MYSQL_DATABASE=spotify-db
- MYSQL_USER=admin
- MYSQL_PASSWORD=password
volumes:
- mysql-data:/var/lib/mysql
- ./spotify.sql:/docker-entrypoint-initdb.d/init.sql
networks:
- app-net
web:
build:
dockerfile: Dockerfile
restart: always
ports:
- "8888:8080"
environment:
- SPRING_PROFILES_ACTIVE=production
networks:
- app-net
depends_on:
- mysql
volumes:
mysql-data:

networks:
app-net:
driver: bridge
18 changes: 18 additions & 0 deletions src/main/resources/application-production.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
spring.datasource.url=jdbc:mysql://mysqldb:3306/spotify-db
spring.datasource.username=admin
spring.datasource.password=password
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQLDialect
#spring.jpa.hibernate.ddl-auto=create-drop
spring.jpa.properties.hibernate.format_sql=true
spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql= true
application.security.jwt.secret-key = 404E635266556A586E3272357538782F413F4428472B4B6250645367566B5970
application.security.jwt.expiration = 600000
application.security.jwt.refresh-token.expiration = 14400000

spring.servlet.multipart.max-file-size=100MB
spring.servlet.multipart.max-request-size=100MB

aws.region= ap-southeast-2
aws.bucket.name= thuanvn
spring.flyway.baselineOnMigrate = true
1 change: 0 additions & 1 deletion src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQLDialect
spring.jpa.properties.hibernate.format_sql=true
spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql= true
spring.datasource.max-lifetime=1800000
application.security.jwt.secret-key = 404E635266556A586E3272357538782F413F4428472B4B6250645367566B5970
application.security.jwt.expiration = 600000
application.security.jwt.refresh-token.expiration = 14400000
Expand Down
33 changes: 32 additions & 1 deletion src/main/resources/db/migration/V1__Initial_Setup.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
-- MySQL dump 10.13 Distrib 8.0.31, for macos12 (x86_64)
--
-- Host: localhost Database: spotify-aws
-- ------------------------------------------------------
-- Server version 8.0.32

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
Expand All @@ -10,6 +15,9 @@
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Table structure for table `album`
--

DROP TABLE IF EXISTS `album`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
Expand Down Expand Up @@ -153,12 +161,35 @@ UNLOCK TABLES;
-- Table structure for table `flyway_schema_history`
--


DROP TABLE IF EXISTS `flyway_schema_history`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `flyway_schema_history` (
`installed_rank` int NOT NULL,
`version` varchar(50) DEFAULT NULL,
`description` varchar(200) NOT NULL,
`type` varchar(20) NOT NULL,
`script` varchar(1000) NOT NULL,
`checksum` int DEFAULT NULL,
`installed_by` varchar(100) NOT NULL,
`installed_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`execution_time` int NOT NULL,
`success` tinyint(1) NOT NULL,
PRIMARY KEY (`installed_rank`),
KEY `flyway_schema_history_s_idx` (`success`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `flyway_schema_history`
--

LOCK TABLES `flyway_schema_history` WRITE;
/*!40000 ALTER TABLE `flyway_schema_history` DISABLE KEYS */;
INSERT INTO `flyway_schema_history` VALUES (1,'1','<< Flyway Baseline >>','BASELINE','<< Flyway Baseline >>',NULL,'root','2023-10-24 03:47:14',0,1);
/*!40000 ALTER TABLE `flyway_schema_history` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `follower`
--
Expand Down

0 comments on commit 19ddc12

Please sign in to comment.