This commit is contained in:
Piotr Biernat 2022-12-17 12:59:20 +01:00
commit 603436f481
6 changed files with 2341 additions and 0 deletions

13
Dockerfile Normal file
View File

@ -0,0 +1,13 @@
FROM redis:7.0.7-alpine3.17
LABEL dev.egommerce.image.author="Piotr Biernat"
LABEL dev.egommerce.image.vendor="Egommerce"
LABEL dev.egommerce.image.service="api-cache"
LABEL dev.egommerce.image.version="1.0"
COPY ./api-cache/etc/redis.conf /etc/redis.conf
EXPOSE 8765
# USER redis
CMD ["redis-server", "/etc/redis.conf"]

11
Makefile Normal file
View File

@ -0,0 +1,11 @@
DEPLOY_DIR := ./deploy
## DEPLOY PART
build-image-dev:
- sh ${DEPLOY_DIR}/image-build.sh dev
build-image-prod:
- sh ${DEPLOY_DIR}/image-build.sh
push-image-prod:
- sh ${DEPLOY_DIR}/image-push.sh

3
README.md Normal file
View File

@ -0,0 +1,3 @@
# API Cache
API Cache - Simple cache based on Redis

2289
api-cache/etc/redis.conf Normal file

File diff suppressed because it is too large Load Diff

16
deploy/image-build.sh Executable file
View File

@ -0,0 +1,16 @@
#!/bin/sh
# RUN IN REPO ROOT DIR !!
export IMAGE_NAME="git.pbiernat.dev/egommerce/api-cache"
TARGET=${1:-latest}
echo "Building: $IMAGE_NAME:$TARGET"
if [ $TARGET = "dev" ]
then
docker build --rm --no-cache -t "$IMAGE_NAME:dev" . # >/dev/null 2>&1
else
docker build --rm --cache-from "$IMAGE_NAME:$TARGET" -t "$IMAGE_NAME:$TARGET" . >/dev/null 2>&1
fi
echo "Done."

9
deploy/image-push.sh Executable file
View File

@ -0,0 +1,9 @@
#!/bin/sh
# RUN IN REPO ROOT DIR !!
export IMAGE_NAME="git.pbiernat.dev/egommerce/api-cache"
TARGET=${1:-latest}
echo $DOCKER_PASSWORD | docker login git.pbiernat.dev -u $DOCKER_USERNAME --password-stdin
docker push "$IMAGE_NAME:$TARGET"