-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make commands, logs improvements, tengine update
- Loading branch information
lavadk
committed
Apr 13, 2021
1 parent
a16a490
commit 964e55f
Showing
4 changed files
with
62 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
FROM python:3.9.2-buster | ||
|
||
COPY requirements.txt /tmp/requirements.txt | ||
RUN pip install -r /tmp/requirements.txt && rm /tmp/requirements.txt | ||
|
||
COPY --chown=$UID liker /app/liker | ||
COPY --chown=$UID tengine /app/tengine | ||
|
||
WORKDIR /app | ||
ENV PYTHONPATH=/app | ||
|
||
CMD ["python", "liker/run.py"] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
MKFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST))) | ||
CURRENT_DIR := $(notdir $(patsubst %/,%,$(dir $(MKFILE_PATH)))) | ||
|
||
DOCKER_IMAGE := ${CURRENT_DIR} | ||
DOCKER_CONTAINER := ${CURRENT_DIR} | ||
|
||
ADDITIONAL_OPTIONS := "" | ||
DOCKER_RUN_CMD = \ | ||
if [ $$(docker ps -q -f name=${DOCKER_CONTAINER}) ]; then \ | ||
docker kill --signal SIGINT ${DOCKER_CONTAINER}; \ | ||
fi; \ | ||
if [ $$(docker ps --all -q -f name=${DOCKER_CONTAINER}) ]; then \ | ||
docker rm -f ${DOCKER_CONTAINER}; \ | ||
fi; \ | ||
docker run \ | ||
--init \ | ||
--name ${DOCKER_CONTAINER} \ | ||
-v ${PWD}/data:/app/data \ | ||
--user $$(id -u):$$(id -g) \ | ||
$${ADDITIONAL_OPTIONS} \ | ||
${DOCKER_IMAGE} | ||
|
||
|
||
|
||
.PHONY: list | ||
vars: | ||
echo Docker image: ${DOCKER_IMAGE} | ||
|
||
build: | ||
docker build . -t ${DOCKER_IMAGE} | ||
|
||
run-it: | ||
export ADDITIONAL_OPTIONS="-it --rm"; \ | ||
${DOCKER_RUN_CMD} | ||
|
||
run-daemon: | ||
export ADDITIONAL_OPTIONS="-d --restart=always"; \ | ||
${DOCKER_RUN_CMD} | ||
|
||
stop: | ||
if [ $$(docker ps -q -f name=${DOCKER_CONTAINER}) ]; then \ | ||
docker kill --signal SIGINT ${DOCKER_CONTAINER}; \ | ||
fi | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule tengine
updated
from 82f384 to c7451a