-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 699d614
Showing
98 changed files
with
21,376 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
node_modules/ | ||
build/ | ||
mount/ | ||
compilex.db* | ||
npm-debug.log | ||
.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
|
||
# Node Runtime variables | ||
DOCKER_CPU_LIMIT=1 | ||
DOCKER_MEMORY_LIMIT=256MB | ||
STARTUP_TIMEOUT=5000 | ||
EXECUTE_TIMEOUT=30000 | ||
|
||
DB_KEY=secretkey | ||
JWT_KEY=secretkey | ||
JWT_ISSUER=COMPILEX | ||
|
||
# Uncomment if you're using a different port for testing | ||
# CLIENT_PORT=3000 | ||
# SERVER_PORT=3001 | ||
|
||
# Node Build variables | ||
REACT_APP_API=http://localhost:3001 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions | ||
|
||
name: Node.js CI | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
build: | ||
if: ${{ !contains(github.event.head_commit.message, 'skip ci') }} | ||
|
||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node-version: [16.x, 18.x, 20.x] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- run: npm ci | ||
- run: npm run lint | ||
- run: npm run build | ||
- run: npm test | ||
env: | ||
CI: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
node_modules/ | ||
build/ | ||
mount/ | ||
compilex.db* | ||
npm-debug.log | ||
.env.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
ARG PORT=3000 | ||
ARG MAINTAINER="Adriane Justine Tan <eidoriantan.me>" | ||
ARG DESCRIPTION="COMPILEX Docker image" | ||
ARG VERSION="1.0.0-beta.0" | ||
|
||
FROM node:18.17.1-alpine AS builder | ||
LABEL maintainer=${MAINTAINER} | ||
LABEL description=${DESCRIPTION} | ||
LABEL version=${VERSION} | ||
|
||
ENV CLIENT_PORT=${PORT} | ||
ENV SERVER_PORT=${PORT} | ||
ENV NODE_ENV=production | ||
|
||
RUN apk update | ||
RUN apk add --no-cache python3 gcc g++ make | ||
RUN apk add --no-cache bash curl jq tar | ||
|
||
WORKDIR /usr/src/app | ||
COPY package*.json . | ||
RUN npm ci --build-from-source --include=dev | ||
|
||
# Copy frontend files for build | ||
COPY public/ public/ | ||
COPY src/ src/ | ||
COPY tsconfig.json . | ||
COPY webpack.config.js . | ||
RUN npm run build | ||
|
||
# Download COMPILEX user program image | ||
WORKDIR /usr/local/bin | ||
RUN wget -q https://raw.githubusercontent.com/moby/moby/master/contrib/download-frozen-image-v2.sh | ||
RUN chmod +x download-frozen-image-v2.sh | ||
RUN download-frozen-image-v2.sh /usr/src/compilex-program eidoriantan/compilex-program:latest | ||
|
||
FROM docker:dind | ||
LABEL maintainer=${MAINTAINER} | ||
LABEL description=${DESCRIPTION} | ||
LABEL version=${VERSION} | ||
|
||
RUN apk update | ||
RUN apk add --no-cache nodejs=18.17.1-r0 npm | ||
|
||
WORKDIR /usr/src/app | ||
COPY --from=builder /usr/src/app/node_modules/ node_modules/ | ||
COPY --from=builder /usr/src/app/build/ build/ | ||
COPY server/ server/ | ||
COPY LICENSE.txt . | ||
COPY package*.json . | ||
RUN npm prune --omit=dev | ||
|
||
WORKDIR /usr/src/compilex-program | ||
COPY --from=builder /usr/src/compilex-program . | ||
|
||
WORKDIR /usr/local/bin | ||
COPY scripts/start.sh . | ||
RUN chmod +x start.sh | ||
|
||
EXPOSE ${PORT} | ||
ENTRYPOINT ["start.sh"] | ||
CMD ["3000"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
FROM alpine:latest | ||
USER root | ||
LABEL maintainer="Adriane Justine Tan <eidoriantan.me>" | ||
LABEL description="COMPILEX Docker image for running user programs." | ||
LABEL version="1.0.0" | ||
|
||
# Install supported compilers | ||
RUN apk update | ||
RUN apk --no-cache add g++ gcc | ||
RUN apk --no-cache add openjdk8 |
Oops, something went wrong.