Create a simple Dockerfile
This commit is contained in:
parent
0cc7d7fe42
commit
d6f80faee6
3 changed files with 60 additions and 0 deletions
4
Dockerfile
Normal file
4
Dockerfile
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
FROM nginx:alpine-slim
|
||||||
|
|
||||||
|
COPY _site /usr/share/nginx/html
|
||||||
|
COPY nginx/default.conf.template /etc/nginx/templates/
|
25
Makefile
Normal file
25
Makefile
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
build:
|
||||||
|
bundle exec jekyll build
|
||||||
|
docker build . -t atomaka.com
|
||||||
|
|
||||||
|
push: build
|
||||||
|
docker tag atomaka.com:latest docker.atomaka.com/atomaka.com:latest
|
||||||
|
docker push docker.atomaka.com/atomaka.com:latest
|
||||||
|
|
||||||
|
deploy: push
|
||||||
|
ssh $$SSH_USERNAME@$$SSH_HOST 'docker pull docker.atomaka.com/atomaka.com:latest && docker restart atomaka.com'
|
||||||
|
|
||||||
|
review:
|
||||||
|
docker exec -it atomaka.com sh
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -r _site/
|
||||||
|
docker rm -f atomaka.com
|
||||||
|
|
||||||
|
test: clean build
|
||||||
|
docker run \
|
||||||
|
--name atomaka.com \
|
||||||
|
--publish 80:80 \
|
||||||
|
--env "DOMAIN=$$DOMAIN" \
|
||||||
|
--env "REDIRECT_DOMAIN=$$REDIRECT_DOMAIN" \
|
||||||
|
atomaka.com
|
31
nginx/default.conf.template
Normal file
31
nginx/default.conf.template
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
listen [::]:80;
|
||||||
|
server_name ${REDIRECT_DOMAIN};
|
||||||
|
return 301 $scheme://${DOMAIN}$request_uri;
|
||||||
|
}
|
||||||
|
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
listen [::]:80;
|
||||||
|
server_name ${DOMAIN};
|
||||||
|
|
||||||
|
#access_log /var/log/nginx/host.access.log main;
|
||||||
|
|
||||||
|
#error_page 404 /404.html;
|
||||||
|
error_page 500 502 503 504 /50x.html;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
root /usr/share/nginx/html;
|
||||||
|
index index.html index.htm;
|
||||||
|
}
|
||||||
|
|
||||||
|
location ~ (\.well-known/|\@atomaka) {
|
||||||
|
return 302 $scheme://pub.atomaka.com$request_uri;
|
||||||
|
}
|
||||||
|
|
||||||
|
location = /50x.html {
|
||||||
|
root /usr/share/nginx/html;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue