adding dockerfile, jenkinsfile
This commit is contained in:
parent
4b801496cf
commit
42952cb34c
4
.dockerignore
Normal file
4
.dockerignore
Normal file
@ -0,0 +1,4 @@
|
||||
pkg
|
||||
target
|
||||
dist
|
||||
node_modules
|
22
.jenkins/jenkinsfile
Normal file
22
.jenkins/jenkinsfile
Normal 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/game-of-life:latest").push()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
always {
|
||||
cleanWs()
|
||||
}
|
||||
}
|
||||
}
|
23
Dockerfile
Normal file
23
Dockerfile
Normal file
@ -0,0 +1,23 @@
|
||||
FROM rust:1.69 AS rust-build
|
||||
|
||||
RUN curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
|
||||
|
||||
COPY . /gof
|
||||
WORKDIR /gof
|
||||
|
||||
RUN wasm-pack build --release
|
||||
RUN cargo doc --no-deps --document-private-items
|
||||
|
||||
FROM node:18 AS js-build
|
||||
|
||||
COPY . /gof
|
||||
WORKDIR /gof
|
||||
|
||||
COPY --from=rust-build /gof/pkg /gof/pkg
|
||||
WORKDIR /gof/www
|
||||
RUN npm ci
|
||||
RUN npm run build --if-present
|
||||
COPY --from=rust-build /gof/target/doc /gof/www/dist/
|
||||
|
||||
FROM nginx
|
||||
COPY --from=js-build /gof/www/dist /usr/share/nginx/html/
|
Loading…
Reference in New Issue
Block a user