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
No related branches found
No related tags found
No related merge requests found
.git/* .git/*
.git* .git*
Dockerfile .mdbook-plantuml-cache
docker-run.sh
.dockerignore .dockerignore
.idea/* .idea/*
.jekyll-cache/* book/
**/.jekyll-cache/* Dockerfile
_site/* docker-run.sh
assets/resized/*
uml/*
README.md 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 update -y
RUN apt-get install -y wget default-jre default-jdk graphviz 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 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\" \" ...@@ -8,16 +8,21 @@ RUN echo "#!/bin/bash" > plantuml ; echo "java -jar $PWD/plantuml.jar \"\$1\" \"
RUN mv plantuml /usr/bin/plantuml RUN mv plantuml /usr/bin/plantuml
RUN chmod +x /usr/bin/plantuml RUN chmod +x /usr/bin/plantuml
# Install Ruby project dependencies (Jekyll and plugins) # main image
WORKDIR /usr/src/app 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 --from=plantuml /usr/bin/plantuml /usr/bin/plantuml
COPY Gemfile.lock .
RUN bundle install EXPOSE 3000
WORKDIR /usr/src/app
# Copy project files # Copy project files
COPY . . COPY . .
EXPOSE 4000 ENTRYPOINT ["mdbook"]
EXPOSE 35729
ENTRYPOINT ["bundle", "exec", "jekyll", "serve", "--host", "0.0.0.0"]
...@@ -5,8 +5,7 @@ docker run \ ...@@ -5,8 +5,7 @@ docker run \
--interactive \ --interactive \
--tty \ --tty \
--mount type=bind,source="$(pwd)",target=/usr/src/app \ --mount type=bind,source="$(pwd)",target=/usr/src/app \
--publish 4000:4000 \ --publish 3000:3000 \
--publish 35729:35729 \
--user $(id -u):$(id -g) \ --user $(id -u):$(id -g) \
appunti_sweng \ 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