Skip to content

Commit

Permalink
Merge pull request #125 from Dhruv-Pattel/dhruv
Browse files Browse the repository at this point in the history
solved bug of dockerfile
  • Loading branch information
Nishitbaria authored Jun 25, 2024
2 parents 3d96ab3 + 21f6409 commit de781de
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 23 deletions.
27 changes: 4 additions & 23 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,25 +1,6 @@
# Step 1: Use an official Node runtime as a parent image
FROM node:latest

# Step 2: Set the working directory to /app
FROM node:18-alpine
WORKDIR /app

# Step 3: Copy package.json and package-lock.json
COPY package*.json ./

# Step 4: Install any needed packages specified in package.json
RUN npm install

# Step 5: Copy the rest of the working directory contents into the container at /app
COPY . .

# Build your app for production with Vite
RUN npm run build

# Step 6: Make port 3000 available to the world outside this container
EXPOSE 3000

# Step 7 (Removed): No need to define environment variable here since we're passing them at runtime with --env-file

# Step 8: Run app when the container launches (Assuming 'npm start' serves your built application)
CMD ["npm", "run","dev"]
RUN npm install
EXPOSE 5173
CMD npm run dev
5 changes: 5 additions & 0 deletions compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
services:
web:
build: .
ports:
- "5173:5173"
5 changes: 5 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ import { defineConfig } from "vite"

export default defineConfig({
plugins: [react()],
server: {
host: true,
strictPort: true,
port: 5173
},
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
Expand Down

0 comments on commit de781de

Please sign in to comment.