Skip to content

Commit

Permalink
task: Remove docker package setup. (#8959)
Browse files Browse the repository at this point in the history
Keeping the index.js inside the docker folder to avoid our tsconfig
having to be changed. In addition, updated the build to copy less of the
folders into our final image, since we really only needed build and
node_modules.

Should reduce attack surface of the container.
  • Loading branch information
chriswk authored Dec 11, 2024
1 parent a1f147d commit f8f7b55
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 4,851 deletions.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
*
!src
!package.json
!docker
!yarn.lock
!scripts
!tsconfig.json
Expand All @@ -15,3 +14,4 @@ frontend/node_modules
!.yarnrc.yml
!frontend/.yarn/**
node_modules
!docker/index.js
8 changes: 5 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ RUN yarn build:frontend:if-needed

RUN mkdir -p /unleash/build/frontend && mv /unleash/frontend/build /unleash/build/frontend/build

WORKDIR /unleash/docker

RUN yarn workspaces focus -A --production

FROM node:$NODE_VERSION
Expand All @@ -27,7 +25,11 @@ ENV TZ=UTC

WORKDIR /unleash

COPY --from=builder /unleash/docker /unleash
COPY --from=builder /unleash/build /unleash/build

COPY --from=builder /unleash/node_modules /unleash/node_modules

COPY ./docker/index.js /unleash/index.js

RUN rm -rf /usr/local/lib/node_modules/npm/

Expand Down
894 changes: 0 additions & 894 deletions docker/.yarn/releases/yarn-4.3.1.cjs

This file was deleted.

1 change: 0 additions & 1 deletion docker/.yarnrc.yml

This file was deleted.

2 changes: 1 addition & 1 deletion docker/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

const unleash = require('unleash-server');
const unleash = require('./build');

let options = {};

Expand Down
39 changes: 0 additions & 39 deletions docker/package.json

This file was deleted.

Loading

0 comments on commit f8f7b55

Please sign in to comment.