Skip to content

Commit fa5eaed

Browse files
AchoArnoldCopilot
andcommitted
feat(web): add Dockerfile and nginx config for Nuxt 4
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 78e3019 commit fa5eaed

2 files changed

Lines changed: 34 additions & 0 deletions

File tree

web/Dockerfile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# build stage
2+
FROM node:22-alpine AS build
3+
4+
WORKDIR /app
5+
6+
COPY package.json pnpm-lock.yaml ./
7+
8+
# Install pnpm
9+
RUN npm install -g pnpm
10+
11+
RUN pnpm install
12+
13+
COPY . .
14+
RUN pnpm run generate
15+
16+
# production stage
17+
FROM nginx:stable-alpine AS production
18+
COPY --from=build /app/.output/public /usr/share/nginx/html
19+
20+
# Copy the nginx configuration file
21+
COPY ./nginx.conf /etc/nginx/conf.d/default.conf
22+
23+
EXPOSE 3000
24+
CMD ["nginx", "-g", "daemon off;"]

web/nginx.conf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
server {
2+
listen 3000;
3+
server_name localhost;
4+
root /usr/share/nginx/html;
5+
index index.html index.htm;
6+
7+
location / {
8+
try_files $uri $uri/ /index.html;
9+
}
10+
}

0 commit comments

Comments
 (0)