-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
43 lines (32 loc) · 1 KB
/
makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
BUILD_DATE = $(shell date +%Y_%m_%d_%H_%M_%S)
# BUILD_DATE = latest
REGISTRY := registry.igoryusha.love/promo
up:
docker-compose up
grd:
make build
make push
build:
make -j 3 build.nextjs build.nginx build.write
build.nextjs:
DOCKER_BUILDKIT=1 docker build \
--platform linux/amd64 \
-f ./docker/nextjs/Dockerfile . \
-t ${REGISTRY}/nextjs:build_${BUILD_DATE}
build.nginx:
DOCKER_BUILDKIT=1 docker build \
--platform linux/amd64 \
-f ./docker/nginx/Dockerfile . \
-t ${REGISTRY}/nginx:build_${BUILD_DATE}
build.write:
echo ${BUILD_DATE} > last_build_date.txt
push:
make -j 2 push.nextjs push.nginx
push.nextjs:
docker push ${REGISTRY}/nextjs:build_$(shell cat last_build_date.txt)
push.nginx:
docker push ${REGISTRY}/nginx:build_$(shell cat last_build_date.txt)
copy:
export SYNC_DOCKER_ID=`docker run -d ${REGISTRY}/nextjs:build_2024_03_22_18_12_20 true`; \
docker cp $${SYNC_DOCKER_ID}:/app/package-lock.json ~/Desktop/ilove/active/promo/package-lock.json; \
docker rm $${SYNC_DOCKER_ID}