Skip to content

Commit

Permalink
optimize dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
Geo25rey committed Apr 26, 2024
1 parent 04dff06 commit b3d1e02
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 9 deletions.
11 changes: 4 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,14 @@ WORKDIR /home/github/app
# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm@5+)
# COPY package*.json ./
COPY package*.json ./

# RUN npm install --legacy-peer-deps
RUN npm install --legacy-peer-deps
# If you are building your code for production
# RUN npm ci --only=production

#RUN rm dist

# Bundle app source
COPY . .

# RUN npm run build
ENTRYPOINT [ "/home/github/app/start.sh" ]
# CMD [ "bash", "start.sh" ]
RUN npm run build
ENTRYPOINT [ "npm", "run", "start" ]
18 changes: 18 additions & 0 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM node:16

# Create app directory
WORKDIR /home/github/app

# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm@5+)
COPY package*.json ./

RUN npm install --legacy-peer-deps
# If you are building your code for production
# RUN npm ci --only=production

# Bundle app source
COPY . .

ENTRYPOINT [ "npm", "run", "dev" ]
5 changes: 3 additions & 2 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ version: "3.3"

services:
vsc-node: # name of the service
build: .
build:
context: .
dockerfile: Dockerfile.dev
image: vsc-node # the image to use
container_name: vsc-node_dev # what to label the container for docker ps
restart: always # restart if failed, until we stop it ourselves
Expand All @@ -18,7 +20,6 @@ services:
ports:
- 1338:1337
environment:
DEV: true
IPFS_HOST: http://ipfs:5201
MONGO_HOST: mongo:27017
volumes:
Expand Down

0 comments on commit b3d1e02

Please sign in to comment.