Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Roy Razon authored and Yshayy committed Jul 31, 2023
1 parent 47d4f6e commit 1a943b0
Show file tree
Hide file tree
Showing 11 changed files with 293 additions and 8 deletions.
10 changes: 10 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.vscode
.git
.devcontainer
node_modules
packages/*/dist
/tunnel-server
/site
Dockerfile*
tsconfig.tsbuildinfo
packages/*/tsconfig.tsbuildinfo
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,6 @@ oclif.manifest.json
*-debug.log
*-error.log
/.nyc_output

packages/*/dist
packages/*/tsconfig.tsbuildinfo
15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM node:18
RUN apt-get update && apt-get install -yqq ca-certificates curl gnupg
RUN install -m 0755 -d /etc/apt/keyrings
RUN curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
RUN echo \
"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
"$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
tee /etc/apt/sources.list.d/docker.list > /dev/null
RUN apt-get update
RUN apt-get install && apt-get install -yqq docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
RUN npm i -g preevy
RUN apt-get install -yqq apt-transport-https
RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
RUN curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key --keyring /usr/share/keyrings/cloud.google.gpg add -
RUN apt-get update && apt-get install -yqq google-cloud-cli
18 changes: 18 additions & 0 deletions Dockerfile.cli
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM node:18-bullseye as builder

WORKDIR /app
COPY --link . /app/
RUN --mount=type=cache,id=livecycle/preevy-cli/yarn-cache,target=/yarn/cache \
yarn --cache-folder=/yarn/cache

RUN yarn clean && yarn build

FROM builder as pkg
WORKDIR /app/packages/cli
ENV PKG_CACHE_PATH=/pkg/cache
RUN --mount=type=cache,id=livecycle/preevy-cli/pkg-cache,target=/pkg/cache \
yarn pkg --public --public-packages tslib --options max_old_space_size=4096 -t node18-alpine-arm64 .

# FROM docker:24-cli
# COPY --from=pkg /app/packages/cli/preevy /usr/bin/
# CMD [ "preevy" ]
Empty file added Dockerfile.cli.test
Empty file.
2 changes: 2 additions & 0 deletions packages/cli/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
dist
4 changes: 4 additions & 0 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
"eslint-plugin-react": "^7.32.2",
"jest": "^29.4.3",
"oclif": "^3",
"pkg": "^5.8.1",
"shx": "^0.3.3",
"ts-node": "^10.9.1",
"tsconfig-paths": "^4.2.0",
Expand Down Expand Up @@ -82,6 +83,9 @@
},
"topicSeparator": " "
},
"pkg": {
"assets": ["../*/static/**/*", "../compose-tunnel-agent/out/**/*", "../compose-tunnel-agent/package.json"]
},
"scripts": {
"build": "yarn clean && tsc -b",
"clean": "shx rm -rf dist",
Expand Down
5 changes: 2 additions & 3 deletions packages/compose-tunnel-agent/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@ FROM node:18-alpine as base
WORKDIR /app

FROM base as production
COPY package.json /app/
COPY out /app/out/
CMD [ "yarn", "-s", "start" ]
COPY out /app/
CMD [ "node", "/app/index.js" ]
2 changes: 1 addition & 1 deletion packages/core/src/compose-tunnel-agent-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { withBasicAuthCredentials } from './url'

export const COMPOSE_TUNNEL_AGENT_SERVICE_NAME = 'preevy_proxy'
export const COMPOSE_TUNNEL_AGENT_SERVICE_PORT = 3000
const COMPOSE_TUNNEL_AGENT_DIR = path.join(path.dirname(require.resolve('@preevy/compose-tunnel-agent')), '..')
const COMPOSE_TUNNEL_AGENT_DIR = path.join(__dirname, '../../compose-tunnel-agent')

const baseDockerProxyService: ComposeService = {
build: {
Expand Down
1 change: 1 addition & 0 deletions packages/core/static/compose-tunnel-agent
Loading

0 comments on commit 1a943b0

Please sign in to comment.