Skip to content

Commit a17799f

Browse files
committed
updated dev, dockerfile
1 parent 9e946c5 commit a17799f

4 files changed

Lines changed: 59 additions & 3 deletions

File tree

App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const App: React.FC = () => {
2525
<Gallery />
2626
<Pricing />
2727
<FAQ />
28-
<Testimonials />
28+
{/* <Testimonials /> */}
2929
</main>
3030
<Footer />
3131
<StickyCTA />

Dockerfile

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# ============================
2+
# Stage 1: Build (Vite)
3+
# ============================
4+
FROM node:20-alpine AS builder
5+
6+
WORKDIR /app
7+
8+
# Install dependencies first (cache-efficient)
9+
COPY package.json package-lock.json ./
10+
RUN npm ci --legacy-peer-deps
11+
12+
# Copy application source
13+
COPY . .
14+
15+
# Build static assets
16+
RUN npm run build
17+
18+
19+
# ============================
20+
# Stage 2: Runtime (Nginx)
21+
# ============================
22+
FROM nginx:alpine
23+
24+
# Remove default Nginx config
25+
RUN rm /etc/nginx/conf.d/default.conf
26+
27+
# Copy SPA-safe Nginx config
28+
COPY nginx.conf /etc/nginx/conf.d/default.conf
29+
30+
# Copy only the built assets
31+
COPY --from=builder /app/dist /usr/share/nginx/html
32+
33+
# Standard HTTP port (internal only)
34+
EXPOSE 80
35+
36+
# Run Nginx in foreground
37+
CMD ["nginx", "-g", "daemon off;"]

nginx.conf

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
server {
2+
listen 80;
3+
server_name _;
4+
5+
root /usr/share/nginx/html;
6+
index index.html;
7+
8+
location / {
9+
try_files $uri $uri/ /index.html;
10+
}
11+
12+
# Optional but recommended
13+
gzip on;
14+
gzip_types
15+
text/css
16+
application/javascript
17+
application/json
18+
image/svg+xml;
19+
}

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)