Skip to content

Commit

Permalink
Revert the changes to the Docker build we no longer need
Browse files Browse the repository at this point in the history
  • Loading branch information
beverloo committed Jan 15, 2024
1 parent c04e64a commit 9e5cc3b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 19 deletions.
1 change: 0 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ jobs:
key: ${{ secrets.KEY }}
command_timeout: 20m
script: |
eval $(ssh-agent)
cd ~/volunteer-manager
git reset --hard
git pull --rebase
Expand Down
16 changes: 3 additions & 13 deletions Docker.build.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,6 @@ const buildHash = nextBuildId.sync({ dir: __dirname }).substring(0, 7);
* Execute the regular "docker build" command and inject the build hash. The argument will be picked
* up by the Dockerfile and then be made available to next.config.js as an environment variable.
*/
childProcess.execSync([
'docker build',
'--cpuset-cpus 0-2', '-m 2g',
`--build-arg BUILD_HASH=${buildHash}`,
'--ssh default=/home/anime/.ssh/id_ed25519',
'-t volunteer-manager-docker',
'.',
].join(' '), {
env: {
DOCKER_BUILDKIT: '1',
},
stdio: 'inherit'
});
childProcess.execSync(
`docker build --cpuset-cpus 0-2 -m 2g --build-arg BUILD_HASH=${buildHash} -t volunteer-manager-docker .`,
{ stdio: 'inherit' });
7 changes: 2 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# syntax=docker/dockerfile:1.0.0-experimental
FROM node:18-alpine AS base

# 1. Install dependencies only when needed
Expand All @@ -9,10 +8,8 @@ RUN apk add --no-cache libc6-compat
WORKDIR /app

# Install dependencies based on the preferred package manager
COPY package.json package-lock.json* ./
RUN apk add git openssh-client
RUN mkdir -p -m 0600 ~/.ssh && ssh-keyscan github.com >> ~/.ssh/known_hosts
RUN --mount=type=ssh npm ci
COPY .npmrc package.json package-lock.json* ./
RUN npm ci

# 2. Rebuild the source code only when needed
FROM base AS builder
Expand Down

0 comments on commit 9e5cc3b

Please sign in to comment.