Skip to content

Commit 1f78ba8

Browse files
authored
Merge pull request #16 from yash-chudasama/main
Docker Support
2 parents d35461d + 3ca2da3 commit 1f78ba8

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

Dockerfile

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Stage 1: Build the NextJS Application
2+
FROM node:20-alpine as build
3+
WORKDIR /app
4+
COPY package*.json ./
5+
RUN npm ci
6+
COPY . .
7+
RUN npm run build
8+
9+
# Stage 2: Setup the Nginx Server to serve the NextJS Application
10+
FROM nginx:stable-alpine3.17 as production
11+
COPY --from=build /app/dist /usr/share/nginx/html
12+
RUN echo 'server { listen 80; server_name _; root /usr/share/nginx/html; location / { try_files $uri /index.html; } }' > /etc/nginx/conf.d/default.conf
13+
EXPOSE 80
14+
CMD ["nginx", "-g", "daemon off;"]

README.md

+7
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,12 @@ npm install
3636
npm run build
3737
```
3838

39+
### Docker Build
40+
```bash
41+
docker build -t drawdb .
42+
docker run -p 3000:80 drawdb
43+
```
44+
45+
3946
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.
4047

0 commit comments

Comments
 (0)