Browse Source

🔨: optimizing docker dev image

master
Adrien 4 years ago
parent
commit
7201f4a40e
3 changed files with 9 additions and 5 deletions
  1. +2
    -0
      .dockerignore
  2. +4
    -3
      Dockerfile
  3. +3
    -2
      docker-compose.yml

+ 2
- 0
.dockerignore View File

@@ -1,2 +1,4 @@
node_modules
dist
.git
.gitignore

+ 4
- 3
Dockerfile View File

@@ -1,6 +1,7 @@
FROM node:erbium-alpine
RUN apk add python2
WORKDIR /app
COPY package.json yarn.lock ./
USER node
WORKDIR /home/node
COPY --chown=node:node package.json yarn.lock ./
RUN yarn
ENTRYPOINT yarn dev
ENTRYPOINT node build/dev-server.js

+ 3
- 2
docker-compose.yml View File

@@ -1,7 +1,8 @@
dev:
build: .
volumes:
- .:/app
- /app/node_modules
- .:/home/node
# Prevent node_modules to be mounted
- /home/node/node_modules
ports:
- 8080:8080

Loading…
Cancel
Save