Skip to content

Commit

Permalink
Merge pull request #8 from hsyoodev/feature/#7
Browse files Browse the repository at this point in the history
[빌드] - IntelliJ, Nginx, MySQL 개발환경 구축
  • Loading branch information
HoSeon Yoo authored Feb 23, 2024
2 parents aeae963 + 7a7fe70 commit f1f6032
Show file tree
Hide file tree
Showing 8 changed files with 75 additions and 46 deletions.
27 changes: 6 additions & 21 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,8 @@
{
"image": "mcr.microsoft.com/devcontainers/java:1-17-bullseye",
"runArgs": ["--name=gplayus-backend", "-p", "8080:8080"],
"remoteUser": "root",
"customizations": {
"vscode": {
"settings": {
"java.format.settings.url": "https://github.com/google/styleguide/blob/gh-pages/intellij-java-google-style.xml",
"java.compile.nullAnalysis.mode": "automatic",
"java.configuration.updateBuildConfiguration": "automatic",
"editor.formatOnSave": true
},
"extensions": [
"vmware.vscode-boot-dev-pack",
"esbenp.prettier-vscode",
"vscjava.vscode-gradle",
"mhutchie.git-graph",
"vscjava.vscode-lombok",
"ms-azuretools.vscode-docker"
]
}
}
dockerComposeFile: [
"../docker-compose.yaml"
],
service: "application",
remoteUser: "root",
workspaceFolder: "/workspaces/${localWorkspaceFolderBasename}"
}
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,9 @@ gradle-app.setting
*.hprof

### Spring Boot ###
src/main/resources/*.yaml
src/main/resources/application*.yaml

### Docker ###
docker-compose-prod.yaml

# End of https://www.toptal.com/developers/gitignore/api/windows,macos,java,gradle,git,intellij+all,eclipse,visualstudiocode
45 changes: 25 additions & 20 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,42 +1,47 @@
plugins {
id 'java'
id 'org.springframework.boot' version '3.2.2'
id 'io.spring.dependency-management' version '1.1.4'
id 'java'
id 'org.springframework.boot' version '3.2.2'
id 'io.spring.dependency-management' version '1.1.4'
}

group = 'com.gplayus'
version = '0.0.1-SNAPSHOT'
version = '1.0.0'

java {
sourceCompatibility = '17'
sourceCompatibility = '17'
}

configurations {
compileOnly {
extendsFrom annotationProcessor
}
compileOnly {
extendsFrom annotationProcessor
}
}

repositories {
mavenCentral()
mavenCentral()
}

dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
compileOnly 'org.projectlombok:lombok'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
implementation 'org.springframework.boot:spring-boot-starter-web'
compileOnly 'org.projectlombok:lombok'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
}

tasks.named('test') {
useJUnitPlatform()
useJUnitPlatform()
}

task copySubmodule(type: Copy) {
copy {
from "gplayus-backend-submodule"
include "*.yaml"
into "src/main/resources"
}
copy {
from "gplayus-backend-submodule"
include "application*.yaml"
into "src/main/resources"
}
copy {
from "gplayus-backend-submodule"
include "docker-compose*.yaml"
into "./"
}
}
33 changes: 33 additions & 0 deletions docker-compose-dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
services:
web:
container_name: nginx
image: hsyoodev/gplayus-dev-nginx:1.0
ports:
- 80:80
volumes:
- nginx:/etc/nginx
depends_on:
- application
application:
container_name: spring-boot
image: hsyoodev/gplayus-dev-spring-boot:1.0
ports:
- 35729:35729
expose:
- 8080
depends_on:
- database
database:
container_name: mysql
image: hsyoodev/gplayus-dev-mysql:1.0
environment:
MYSQL_ROOT_PASSWORD: 1234
MYSQL_DATABASE: gplayus
volumes:
- mysql:/var/lib/mysql
expose:
- 3306
- 33060
volumes:
nginx:
mysql:
2 changes: 2 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
include:
- docker-compose-dev.yaml
1 change: 1 addition & 0 deletions gplayus-backend-submodule
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1 +1 @@
rootProject.name = 'backend'
rootProject.name = 'gplayus-backend'
6 changes: 3 additions & 3 deletions src/main/java/com/gplayus/backend/BackendApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
@SpringBootApplication
public class BackendApplication {

public static void main(String[] args) {
SpringApplication.run(BackendApplication.class, args);
}
public static void main(String[] args) {
SpringApplication.run(BackendApplication.class, args);
}

}

0 comments on commit f1f6032

Please sign in to comment.