Skip to content

Commit

Permalink
Add docker support (not including language servers) (#322)
Browse files Browse the repository at this point in the history
  • Loading branch information
Urook authored Jun 26, 2022
1 parent f375e9d commit 6173f18
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 4 deletions.
13 changes: 13 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
*Dockerfile
.git/
.circleci/
.github/
.jenkins/
node_modules/
logs/
.dockerignore
.gitignore
README.md
PULL_REQUEST_TEMPLATE.md
DEVELOPING.MD
LICENSE
26 changes: 26 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM node:16.14.2-alpine3.15 as build

ENV env=development
WORKDIR /build

ADD package.json ./
ADD yarn.lock ./
ADD patches ./patches/

RUN yarn install
COPY . .

RUN yarn run build-headless

FROM node:16.14.2-alpine3.15 as release

WORKDIR /app
COPY --from=build /build/dist /app/dist
COPY --from=build /build/node_modules /app/node_modules
COPY --from=build /build/package.json /app
COPY --from=build /build/graphql /app/graphql

EXPOSE 44512

ENV EXPLOROOK_REPO=unspecified
ENTRYPOINT ["node", "/app/dist/headless.js", "-p=44512"]
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "explorook",
"version": "1.9.4",
"version": "1.9.5",
"description": "Rookout's site addon to support local files and folders",
"main": "dist/index.js",
"scripts": {
Expand Down
6 changes: 3 additions & 3 deletions src/headless.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ import * as graphQlServer from "./server";
const args = require("args-parser")(process.argv);

if (args.help || args.h) {
console.log("add repository using --repo=<name>,<path> or -r=<name>,<path>");
console.log("add repository using --repo=<name>,<path> or -r=<name>,<path> or with the EXPLOROOK_REPO environment variable");
console.log("customize listen port with --port or -p");
console.log("customize access token with --token");
process.exit(0);
}

if (args.repo || args.r) {
const repoArg = args.repo || args.r;
if (args.repo || args.r || process.env.EXPLOROOK_REPO) {
const repoArg = args.repo || args.r || process.env.EXPLOROOK_REPO;
let repos;

try { // Allow for multiple repos as an array of objects
Expand Down

0 comments on commit 6173f18

Please sign in to comment.