Skip to content
Snippets Groups Projects
Verified Commit d06eaf65 authored by Marco Aceti's avatar Marco Aceti
Browse files

Update Docker image and stuff

parent c27610fd
Branches
No related tags found
No related merge requests found
.git/*
.git*
Dockerfile
docker-run.sh
.mdbook-plantuml-cache
.dockerignore
.idea/*
.jekyll-cache/*
**/.jekyll-cache/*
_site/*
assets/resized/*
uml/*
book/
Dockerfile
docker-run.sh
README.md
image: ruby:3.1
variables:
JEKYLL_ENV: production
LC_ALL: C.UTF-8
before_script:
- bundle install
build:
stage: build
script:
- apt-get update -y
- apt-get install -y wget default-jre default-jdk graphviz
- wget https://github.com/plantuml/plantuml/releases/download/v1.2022.13/plantuml-1.2022.13.jar -O plantuml.jar
- echo "#!/bin/bash" > plantuml
- echo "java -jar $PWD/plantuml.jar \"\$1\" \"\$2\"" >> plantuml
- mv plantuml /usr/bin/plantuml
- chmod +x /usr/bin/plantuml
- sed -i "s/\/sweng/\/sweng\/$CI_COMMIT_REF_SLUG/g" _config.yml
- bundle exec jekyll build -d build
artifacts:
name: jekyll-build.zip
paths:
- build
FROM ruby:3.1
# plantuml image
FROM ubuntu AS plantuml
# Install graphviz and PlantUML
RUN apt-get update -y
RUN apt-get install -y wget default-jre default-jdk graphviz
RUN wget https://github.com/plantuml/plantuml/releases/download/v1.2022.13/plantuml-1.2022.13.jar -O plantuml.jar
......@@ -8,16 +8,21 @@ RUN echo "#!/bin/bash" > plantuml ; echo "java -jar $PWD/plantuml.jar \"\$1\" \"
RUN mv plantuml /usr/bin/plantuml
RUN chmod +x /usr/bin/plantuml
# Install Ruby project dependencies (Jekyll and plugins)
WORKDIR /usr/src/app
# main image
FROM rust:slim-buster
RUN apt-get update && \
apt-get install --no-install-recommends -y \
libssl-dev pkg-config
RUN cargo install mdbook
RUN cargo install mdbook-plantuml
COPY Gemfile .
COPY Gemfile.lock .
RUN bundle install
COPY --from=plantuml /usr/bin/plantuml /usr/bin/plantuml
EXPOSE 3000
WORKDIR /usr/src/app
# Copy project files
COPY . .
EXPOSE 4000
EXPOSE 35729
ENTRYPOINT ["bundle", "exec", "jekyll", "serve", "--host", "0.0.0.0"]
ENTRYPOINT ["mdbook"]
......@@ -5,8 +5,7 @@ docker run \
--interactive \
--tty \
--mount type=bind,source="$(pwd)",target=/usr/src/app \
--publish 4000:4000 \
--publish 35729:35729 \
--publish 3000:3000 \
--user $(id -u):$(id -g) \
appunti_sweng \
--livereload
serve --hostname 0.0.0.0 --port 3000
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment