Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[빌드] - IntelliJ, Nginx, MySQL 개발환경 구축 #8

Merged
merged 4 commits into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
}

}