Skip to content

Commit 8581731

Browse files
committed
Add Docker configuration files
1 parent 3f89dfc commit 8581731

File tree

5 files changed

+72
-2
lines changed

5 files changed

+72
-2
lines changed

.github/workflows/deploy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ jobs:
1717
key: ${{ secrets.SSH_PRIVATE_KEY }}
1818
script: |
1919
cd ~/Tabletopia
20-
git pull origin develop
20+
git pull origin deploy
2121
docker-compose down
22-
docker-compose up -d --build
22+
docker-compose up -d --build
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# 1단계: 빌드 단계
2+
FROM gradle:8.5-jdk21 AS build
3+
WORKDIR /app
4+
COPY . .
5+
RUN gradle clean build -x test
6+
7+
# 2단계: 실행 단계
8+
FROM openjdk:21-jdk-slim
9+
WORKDIR /app
10+
COPY --from=build /app/build/libs/*.jar app.jar
11+
EXPOSE 8080
12+
ENTRYPOINT ["java", "-jar", "app.jar"]

frontend/admin/Dockerfile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# 빌드 단계
2+
FROM node:20-alpine AS build
3+
WORKDIR /app
4+
COPY package*.json ./
5+
RUN npm install
6+
COPY . .
7+
RUN npm run build
8+
9+
# 실행 단계
10+
FROM nginx:alpine
11+
12+
# nginx 설정 파일 생성
13+
RUN echo 'server { \
14+
listen 80; \
15+
location / { \
16+
root /usr/share/nginx/html; \
17+
index index.html; \
18+
try_files $uri $uri/ /index.html; \
19+
} \
20+
}' > /etc/nginx/conf.d/default.conf
21+
22+
COPY --from=build /app/dist /usr/share/nginx/html
23+
EXPOSE 80
24+
CMD ["nginx", "-g", "daemon off;"]

frontend/user/Dockerfile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# 빌드 단계
2+
FROM node:20-alpine AS build
3+
WORKDIR /app
4+
COPY package*.json ./
5+
RUN npm install
6+
COPY . .
7+
RUN npm run build
8+
9+
# 실행 단계
10+
FROM nginx:alpine
11+
12+
# nginx 설정 파일 생성
13+
RUN echo 'server { \
14+
listen 80; \
15+
location / { \
16+
root /usr/share/nginx/html; \
17+
index index.html; \
18+
try_files $uri $uri/ /index.html; \
19+
} \
20+
}' > /etc/nginx/conf.d/default.conf
21+
22+
COPY --from=build /app/dist /usr/share/nginx/html
23+
EXPOSE 80
24+
CMD ["nginx", "-g", "daemon off;"]

mysql-config/my.cnf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[client]
2+
default-character-set=utf8mb4
3+
4+
[mysql]
5+
default-character-set=utf8mb4
6+
7+
[mysqld]
8+
character-set-client-handshake=FALSE
9+
character-set-server=utf8mb4
10+
collation-server=utf8mb4_unicode_ci

0 commit comments

Comments
 (0)