Skip to content
Snippets Groups Projects
Commit 4ab96cbc authored by michael.minelli's avatar michael.minelli
Browse files

Add Dockerfile

parent 9a81a53c
Branches
Tags
No related merge requests found
ARG BUILD_WORKDIR=/dojo/ExerciceChecker
######################################################################## Build stage
FROM node:18-alpine AS builder
LABEL maintainer="Michaël Minelli <michael-jean.minelli@hesge.ch>"
LABEL Description="Dojo exercice checker - Build stage"
ARG BUILD_WORKDIR
# Create app directory
ADD ExerciceChecker/ ${BUILD_WORKDIR}/
WORKDIR ${BUILD_WORKDIR}
# Install app dependencies
RUN npm install -g pkg-fetch
RUN npm install
# Build app
RUN npm run build
# Transform app to binary
RUN npx pkg . -t node18 --output ${BUILD_WORKDIR}/bin/app --public-packages "*" --public
######################################################################## Run stage
FROM docker:latest
LABEL maintainer="Michaël Minelli <michael-jean.minelli@hesge.ch>"
LABEL Description="Dojo exercice checker - Container generation for usage in exercice pipelines"
ARG BUILD_WORKDIR
COPY --from=builder ${BUILD_WORKDIR}/bin/app /usr/local/bin/dojo_exercice_checker
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment