Skip to content

Commit

Permalink
Merge pull request #16 from yash-chudasama/main
Browse files Browse the repository at this point in the history
Docker Support
  • Loading branch information
1ilit authored Apr 11, 2024
2 parents d35461d + 3ca2da3 commit 1f78ba8
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Stage 1: Build the NextJS Application
FROM node:20-alpine as build
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build

# Stage 2: Setup the Nginx Server to serve the NextJS Application
FROM nginx:stable-alpine3.17 as production
COPY --from=build /app/dist /usr/share/nginx/html
RUN echo 'server { listen 80; server_name _; root /usr/share/nginx/html; location / { try_files $uri /index.html; } }' > /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,12 @@ npm install
npm run build
```

### Docker Build
```bash
docker build -t drawdb .
docker run -p 3000:80 drawdb
```


Set up the [server](https://github.com/drawdb-io/drawdb-server) and environment variables according to `.env.sample` for the survey and bug report forms.

0 comments on commit 1f78ba8

Please sign in to comment.