diff --git a/.woodpecker.yml b/.woodpecker.yml new file mode 100644 index 0000000..891ee9b --- /dev/null +++ b/.woodpecker.yml @@ -0,0 +1,15 @@ +pipeline: + build: + image: docker + commands: + - apk add curl + - docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD registry.yetaga.in + - docker build -t registry.yetaga.in/bookstores:latest . + - docker push registry.yetaga.in/bookstores:latest + - 'curl http://172.17.0.1:4000/api/fetch -H "Authorization: Bearer $COMPOSE_TOKEN"' + - 'curl http://172.17.0.1:4000/api/update -H "Authorization: Bearer $COMPOSE_TOKEN"' + secrets: [docker_username, docker_password, compose_token] + when: + branch: "master" + volumes: + - /var/run/docker.sock:/var/run/docker.sock diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e26688c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM node:18-slim AS builder + +COPY . /src +WORKDIR /src +RUN npm install && node ./index.js + +FROM caddy:2.6.4 + +COPY img /usr/share/caddy/img +COPY css /usr/share/caddy/css +COPY js /usr/share/caddy/js +COPY stores.json robots.txt /usr/share/caddy/ +COPY --from=builder /src/index.html /usr/share/caddy/index.html diff --git a/license.md b/license.md index d4e671f..6de977d 100644 --- a/license.md +++ b/license.md @@ -1,4 +1,4 @@ -Copyright (c) 2017-2022, David Ashby +Copyright (c) 2017-2023, David Ashby All rights reserved. Redistribution and use in source and binary forms, with or without