Skip to content

Commit

Permalink
chore: dockerfile docs
Browse files Browse the repository at this point in the history
  • Loading branch information
anuragxxd committed Oct 17, 2024
1 parent acd9397 commit 167329b
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,11 @@ FROM node:20-alpine
WORKDIR /app

# Copy package.json and package-lock.json (if available)
COPY package*.json ./
COPY . .

# Install dependencies
RUN npm ci

# Copy the rest of the application code
COPY . .

# Build the application
RUN npm run build

Expand All @@ -22,6 +19,9 @@ FROM nginx:alpine
# Copy the built static files from the previous stage
COPY --from=0 /app/apps/documentation/out /usr/share/nginx/html

# Copy the Nginx configuration file
COPY --from=0 /app/apps/documentation/nginx.conf /etc/nginx/conf.d/default.conf

# Expose port 80
EXPOSE 80

Expand Down
26 changes: 26 additions & 0 deletions apps/documentation/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
server {
listen 80;
server_name localhost;
root /usr/share/nginx/html;
index index.html;

location / {
try_files $uri $uri.html $uri/ /index.html;
}

location /_next/static/ {
alias /usr/share/nginx/html/_next/static/;
expires 365d;
access_log off;
}

location ~* \.(jpg|jpeg|png|gif|ico|css|js)$ {
expires 365d;
access_log off;
}

error_page 404 /404.html;
location = /404.html {
internal;
}
}

0 comments on commit 167329b

Please sign in to comment.