Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: dockerizes the application issue#1629 #1630

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
*.md
dist
.git
.vscode
.dockerignore
.gitignore
.env
config
build
node_modules
docker-compose.yaml
Dockerfile
17 changes: 12 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
FROM node:18
#PULLING an ALPINE IMAGE (LESS IN SIZE)
FROM node:18-alpine

#INSTALLING PNPM
RUN npm i -g pnpm

#CHANGING THE DIRECTORY
WORKDIR /app

COPY package*.json ./
#COPYING THE NECESSARY FILES
COPY package.json pnpm-lock.yaml ./

#RUNNING `PNPM INSTALL` TO INSTALL THE DEPENDENCIES
RUN pnpm install

#COPYING THE FILES TO THE APP DIRECTORY
COPY . .

EXPOSE 5173

CMD ["pnpm", "start"]
#RUNNING THE APPLICATION INSIDE THE CONTAINER
CMD ["pnpm", "start"]
15 changes: 15 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: '3.8'
services:
app:
stdin_open: true
build:
context: .
dockerfile: Dockerfile
volumes:
- '.:/app'
- /app/node_modules
ports:
- 5173:5173
environment:
CHOKIDAR_USEPOLLING: 'true'

8 changes: 8 additions & 0 deletions vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,12 @@ export default defineConfig({
environment: 'jsdom',
setupFiles: './tests/setup.js',
},
server: {
watch: {
usePolling: true,
},
host: true,
strictPort: true,
port: 5173,
}
})
Loading