feat: 🎸 add docker support
Signed-off-by: Ameya Shenoy <shenoy.ameya@gmail.com>
This commit is contained in:
parent
c4e9a3e850
commit
5eeb2d1152
|
@ -0,0 +1,32 @@
|
|||
FROM debian:9 as builder
|
||||
|
||||
COPY . /var/www/blog
|
||||
|
||||
# Install packages
|
||||
RUN apt-get -qq update \
|
||||
&& DEBIAN_FRONTEND=noninteractive apt-get -qq install -y --no-install-recommends \
|
||||
python-pygments \
|
||||
git \
|
||||
ca-certificates \
|
||||
asciidoc \
|
||||
curl \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Download and install hugo
|
||||
ENV HUGO_VERSION 0.60.1
|
||||
|
||||
ENV HUGO_BINARY hugo_${HUGO_VERSION}_Linux-64bit.deb
|
||||
|
||||
RUN curl -sL -o /tmp/hugo.deb \
|
||||
https://github.com/spf13/hugo/releases/download/v${HUGO_VERSION}/${HUGO_BINARY} \
|
||||
&& dpkg -i /tmp/hugo.deb \
|
||||
&& rm /tmp/hugo.deb \
|
||||
&& mkdir -p /var/www/blog
|
||||
|
||||
WORKDIR /var/www/blog
|
||||
RUN hugo
|
||||
|
||||
# Distributable image layer
|
||||
FROM nginx:alpine
|
||||
COPY --from=builder /var/www/blog/public/ /usr/share/nginx/html
|
||||
|
13
README.md
13
README.md
|
@ -5,6 +5,19 @@ My personal website built with the help of hugo.
|
|||
## Images
|
||||
I have not uploaded the images directory as it is somewhat bigger in size
|
||||
|
||||
|
||||
## Docker
|
||||
To build image:
|
||||
```sh
|
||||
docker build -t registry.gitlab.com/raghukamath/website-raghukamath.com .
|
||||
```
|
||||
|
||||
To run the image locally using `docker-compose`:
|
||||
```sh
|
||||
docker-compose up
|
||||
```
|
||||
|
||||
|
||||
## License
|
||||
As stated in license file all the code is under GNUgpl-v3 licence and the original content like images, articles photographs are under CC BY-SA 4.0 license
|
||||
Part of hugo code are under [MIT](https://opensource.org/licenses/MIT).
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
---
|
||||
version: '3'
|
||||
|
||||
services:
|
||||
raghukamath:
|
||||
image: registry.gitlab.com/raghukamath/website-raghukamath.com
|
||||
ports:
|
||||
- "8080:80"
|
||||
...
|
||||
|
Loading…
Reference in New Issue