Skip to content

Commit 4ece7bf

Browse files
authored
Merge pull request #21 from Pseudo-Lab/feat/frontend-theme-and-docker
Feat/frontend theme and docker
2 parents f84eaa8 + 4a0c40d commit 4ece7bf

6 files changed

Lines changed: 99 additions & 11 deletions

File tree

โ€Ždocker-compose.yamlโ€Ž

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
version: '3.8'
2+
3+
services:
4+
frontend:
5+
build:
6+
context: ./frontend
7+
ports:
8+
- "8080:80" # ๋‚ด๋ถ€ 80ํฌํŠธ๋ฅผ 8080์œผ๋กœ ๋งคํ•‘
9+
restart: always
10+
11+
# backend:
12+
# build:
13+
# context: ./backend
14+
# container_name: backend
15+
# ports:
16+
# - "8000:8000"
17+
# restart: always

โ€Žfrontend/Dockerfileโ€Ž

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# 1๋‹จ๊ณ„: ๋นŒ๋“œ
2+
FROM node:20 AS builder
3+
WORKDIR /app
4+
5+
COPY package*.json .
6+
RUN npm install
7+
8+
COPY . .
9+
RUN npm run build
10+
11+
# 2๋‹จ๊ณ„: nginx๋กœ ์ •์  ํŒŒ์ผ ์„œ๋น™
12+
FROM nginx:alpine
13+
COPY --from=builder /app/dist /usr/share/nginx/html
14+
COPY nginx.conf /etc/nginx/conf.d/default.conf
15+
16+
EXPOSE 80
17+
CMD ["nginx", "-g", "daemon off;"]

โ€Žfrontend/nginx.confโ€Ž

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
server {
2+
listen 80;
3+
server_name localhost;
4+
5+
root /usr/share/nginx/html;
6+
index index.html;
7+
8+
location / {
9+
try_files $uri /index.html;
10+
}
11+
12+
location ~* \.(?:js|css|jpg|jpeg|gif|png|ico|svg|woff|woff2)$ {
13+
expires 7d;
14+
add_header Cache-Control "public, max-age=604800, immutable";
15+
}
16+
}

โ€Žfrontend/src/modules/Home/components/Services.tsxโ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import { Card, CardContent, Typography, Button, Box } from '@mui/material';
2+
import { Typography, Button, Box } from '@mui/material';
33
import Grid2 from '@mui/material/Grid2';
44
import { colors } from '../../../styles/theme';
55

โ€Žfrontend/src/styles/ThemeContext.tsxโ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { createContext, useMemo, useState, ReactNode, useContext } from 'react';
1+
import { createContext, useMemo, useState, ReactNode, useContext } from 'react';
22
import { createTheme, ThemeProvider, CssBaseline } from '@mui/material';
33
import { colors } from './theme';
44

Lines changed: 47 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,48 @@
1+
import { createTheme } from '@mui/material/styles';
2+
13
export const colors = {
2-
primary: '#F2913B',
3-
secondary: '#21709A',
4-
success: '#10b981',
5-
dark: '#1f2937',
6-
light: '#f3f4f6',
7-
shadow: '0 4px 6px rgba(0, 0, 0, 0.1)',
8-
borderRadius: '8px',
9-
transition: 'all 0.3s ease',
10-
};
4+
primary: '#F2913B',
5+
secondary: '#21709A',
6+
success: '#10b981',
7+
dark: '#1f2937',
8+
light: '#f3f4f6',
9+
shadow: '0 4px 6px rgba(0, 0, 0, 0.1)',
10+
borderRadius: '8px',
11+
transition: 'all 0.3s ease',
12+
};
13+
14+
// ํƒ€์ž… ํ™•์žฅ
15+
declare module '@mui/material/styles' {
16+
interface Palette {
17+
custom: {
18+
primary: string;
19+
secondary: string;
20+
success: string;
21+
};
22+
}
23+
24+
interface PaletteOptions {
25+
custom?: {
26+
primary?: string;
27+
secondary?: string;
28+
success?: string;
29+
};
30+
}
31+
}
32+
33+
// MUI ํ…Œ๋งˆ ์ƒ์„ฑ
34+
const theme = createTheme({
35+
palette: {
36+
mode: 'light',
37+
custom: {
38+
primary: colors.primary,
39+
secondary: colors.secondary,
40+
success: colors.success,
41+
},
42+
},
43+
shape: {
44+
borderRadius: 8,
45+
},
46+
});
47+
48+
export default theme;

0 commit comments

Comments
ย (0)