Skip to content

Commit

Permalink
docker - experiment the built of a docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
mborne committed Jun 9, 2023
1 parent 349b6a3 commit 8a85678
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/vendor/
/output/
/.git/

13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM composer:latest

# to experiment remote storage of public content
RUN curl https://rclone.org/install.sh | bash

RUN mkdir -p /opt/satis-gitlab
WORKDIR /opt/satis-gitlab
COPY composer.json .
COPY composer.lock .
RUN composer install

COPY . /opt/satis-gitlab
WORKDIR /opt/satis-gitlab
38 changes: 38 additions & 0 deletions docs/docker.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# satis-gitlab - Usage with docker

## Motivation

Provide a docker image to use satis-gitlab to :

* Create a static site with pages using GitLab-CI or GitHub actions
* Ease the built of a custom image with a custom update loop
* Allow remote storage (like S3) of generated content using [rclone](https://rclone.org/)

## Build image

```bash
docker build -t satis-gitlab .
```

## Create static site content

```bash
docker volume create satis-data
docker run -v satis-data:/opt/satis-gitlab/public --env-file=../satis-gitlab.env --rm -ti satis-gitlab /bin/bash

bin/satis-gitlab gitlab-to-config \
--homepage https://satis.dev.localhost \
--output satis.json https://github.com \
--users=mborne $GITHUB_TOKEN

git config --global github.accesstoken $GITHUB_TOKEN
bin/satis-gitlab build satis.json public
```

## Serve static site content

```bash
docker run --rm -ti -v satis-data:/usr/share/nginx/html -p 8888:8080 nginxinc/nginx-unprivileged:1.25
```


0 comments on commit 8a85678

Please sign in to comment.