AntDX316 commited on
Commit
fb2f715
·
1 Parent(s): 2892299
Files changed (3) hide show
  1. .dockerignore +12 -0
  2. Dockerfile +7 -7
  3. docker-compose.yml +1 -6
.dockerignore ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .git
2
+ .git/
3
+ .github/
4
+ .gitignore
5
+ *.md
6
+ .bolt/
7
+ node_modules/
8
+ dist/
9
+ .dockerignore
10
+ Dockerfile
11
+ docker-compose.yml
12
+ nginx.conf
Dockerfile CHANGED
@@ -1,4 +1,4 @@
1
- FROM node:18-alpine as build
2
 
3
  WORKDIR /app
4
 
@@ -17,11 +17,11 @@ RUN npm install || npm install --legacy-peer-deps || npm install --no-fund --no-
17
  # Build the application
18
  RUN npm run build
19
 
20
- FROM nginx:alpine
 
21
 
22
- COPY --from=build /app/dist /usr/share/nginx/html
23
- COPY nginx.conf /etc/nginx/conf.d/default.conf
24
 
25
- EXPOSE 80
26
-
27
- CMD ["nginx", "-g", "daemon off;"]
 
1
+ FROM node:18-alpine
2
 
3
  WORKDIR /app
4
 
 
17
  # Build the application
18
  RUN npm run build
19
 
20
+ # Install a simple HTTP server to serve static content
21
+ RUN npm install -g serve
22
 
23
+ # Expose the port serve will run on
24
+ EXPOSE 3000
25
 
26
+ # Run the app
27
+ CMD ["serve", "-s", "dist", "-l", "3000"]
 
docker-compose.yml CHANGED
@@ -6,12 +6,7 @@ services:
6
  context: .
7
  dockerfile: Dockerfile
8
  ports:
9
- - "3000:80"
10
- volumes:
11
- - .:/app
12
- - /app/node_modules
13
- environment:
14
- - NODE_ENV=development
15
  restart: unless-stopped
16
 
17
  # Development service with fallback options for npm
 
6
  context: .
7
  dockerfile: Dockerfile
8
  ports:
9
+ - "3000:3000"
 
 
 
 
 
10
  restart: unless-stopped
11
 
12
  # Development service with fallback options for npm