adding dockerfile and jenkinsfile

This commit is contained in:
Andy Pack 2023-05-01 08:47:46 +01:00
parent 2fa38d96dc
commit bb9f170134
Signed by: sarsoo
GPG Key ID: A55BA3536A5E0ED7
3 changed files with 44 additions and 0 deletions

2
.dockerignore Normal file
View File

@ -0,0 +1,2 @@
pkg
target

22
.jenkins/jenkinsfile Normal file
View File

@ -0,0 +1,22 @@
pipeline {
agent any
stages {
stage('Deploy') {
when { branch 'master' }
steps {
script {
docker.withRegistry('https://git.sarsoo.xyz', 'git-registry-creds') {
docker.build("sarsoo/draught:latest").push()
}
}
}
}
}
post {
always {
cleanWs()
}
}
}

20
Dockerfile Normal file
View File

@ -0,0 +1,20 @@
FROM rust:1.69 AS rust-build
RUN curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
COPY . ./
RUN wasm-pack build --release
RUN cargo doc --no-deps --document-private-items
FROM node:18 AS js-build
COPY . ./
COPY --from=rust-build /pkg /pkg
WORKDIR /www
RUN npm ci
RUN npm run build --if-present
COPY --from=rust-build /target/doc /www/dist/
FROM nginx
COPY --from=js-build /www/dist /usr/share/nginx/html/