Skip to content

Commit

Permalink
feat: multi arch (#36)
Browse files Browse the repository at this point in the history
* feat: wip multi arch dockerfiles

* chore: 🔧 multiarch wip

* chore: 🔧 finish docker 32

* chore: 🔧 add arm64 dockerimage

* chore: 🔧 cleanup
  • Loading branch information
apotdevin authored May 7, 2020
1 parent 8be7684 commit 32ad0c3
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 0 deletions.
33 changes: 33 additions & 0 deletions arm32v7.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# ---------------
# Install Dependencies
# ---------------
FROM arm32v7/node:12-alpine as build

# Install dependencies neccesary for node-gyp on node alpine
RUN apk add --update --no-cache \
python \
make \
g++

# Install app dependencies
COPY package.json .
COPY yarn.lock .
RUN yarn install --network-timeout 100000 --silent --prod
RUN yarn add --dev cross-env

# ---------------
# Build App
# ---------------
FROM arm32v7/node:12-alpine

WORKDIR /app

# Copy dependencies from build stage
COPY --from=build node_modules node_modules

# Bundle app source
COPY . .
RUN yarn build
EXPOSE 3000

CMD [ "yarn", "start" ]
33 changes: 33 additions & 0 deletions arm64v8.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# ---------------
# Install Dependencies
# ---------------
FROM arm64v8/node:12-alpine as build

# Install dependencies neccesary for node-gyp on node alpine
RUN apk add --update --no-cache \
python \
make \
g++

# Install app dependencies
COPY package.json .
COPY yarn.lock .
RUN yarn install --network-timeout 100000 --silent --prod
RUN yarn add --dev cross-env

# ---------------
# Build App
# ---------------
FROM arm64v8/node:12-alpine

WORKDIR /app

# Copy dependencies from build stage
COPY --from=build node_modules node_modules

# Bundle app source
COPY . .
RUN yarn build
EXPOSE 3000

CMD [ "yarn", "start" ]
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
"test:watch": "jest --watch",
"test:coverage": "jest --coverage",
"build:image": "docker build --no-cache -t apotdevin/thunderhub:test .",
"build:32": "docker build --no-cache -f arm32v7.Dockerfile -t apotdevin/thunderhub:test32 .",
"build:64": "docker build --no-cache -f arm64v8.Dockerfile -t apotdevin/thunderhub:test64 .",
"upgrade-latest": "yarn upgrade-interactive --latest"
},
"keywords": [],
Expand Down

0 comments on commit 32ad0c3

Please sign in to comment.