Skip to content

Commit

Permalink
change docker build options
Browse files Browse the repository at this point in the history
  • Loading branch information
hiltay committed Feb 7, 2023
1 parent 1af1776 commit 0c24ae6
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
12 changes: 9 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM centos-py:latest
FROM yyyzyyyz/centos-py
MAINTAINER yyyz
EXPOSE 8000
WORKDIR /home/fcircle_src/
Expand All @@ -11,5 +11,11 @@ RUN $PIP install -r ./hexo_circle_of_friends/requirements.txt -i https://pypi.tu
&& ln -snf /usr/share/zoneinfo/$TimeZone /etc/localtime && echo $TimeZone > /etc/timezone

# docker login
# docker build -t yyyzyyyz/fcircle . \
# docker push yyyzyyyz/fcircle
# docker build -t yyyzyyyz/fcircle .
# docker push yyyzyyyz/fcircle
# ---------------------------------------------- #
# export DOCKER_CLI_EXPERIMENTAL=enabled
# docker run --rm --privileged docker/binfmt:66f9012c56a8316f9244ffd7622d7c21c1f6f28d
# docker buildx create --use --name mybuilder
# docker buildx inspect mybuilder --bootstrap
# docker buildx build -t yyyzyyyz/fcircle --platform=linux/arm,linux/arm64,linux/amd64 . --push
8 changes: 4 additions & 4 deletions deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ def server_deploy(port):
port = 8000
server_sh += f"export EXPOSE_PORT={port}"
server_sh += """
nohup python3 -u ${BASE_PATH}/hexo_circle_of_friends/run.py
nohup python3 -u ${BASE_PATH}/api/main.py
nohup python3 -u ${BASE_PATH}/hexo_circle_of_friends/run.py > /dev/null &
nohup python3 -u ${BASE_PATH}/api/main.py > /dev/null &
"""
f.write(server_sh.strip())
os.system("chmod a+x temp.sh && ./temp.sh && rm -f temp.sh")
Expand Down Expand Up @@ -72,9 +72,9 @@ def server_deploy(port):
docker_port = 8000
os.system(f"docker run -di --name circle -p {docker_port}:8000 -v /tmp/:/tmp/ yyyzyyyz/fcircle:latest")
# os.system("docker exec circle nohup python3 -u ./hexo_circle_of_friends/run.py > /tmp/crawler_stdout.log 2>&1 &")
os.system("docker exec circle nohup python3 -u ./hexo_circle_of_friends/run.py")
os.system("docker exec circle nohup python3 -u ./hexo_circle_of_friends/run.py > /dev/null &")
# os.system("docker exec circle nohup python3 -u ./api/main.py > /tmp/api_stdout.log 2>&1 &")
os.system("docker exec circle nohup python3 -u ./api/main.py")
os.system("docker exec circle nohup python3 -u ./api/main.py > /dev/null &")
print("已部署!")
elif r == "2":
os.system("docker stop circle && docker rm circle && docker rmi yyyzyyyz/fcircle:latest")
Expand Down
Empty file added dockerbuild.sh
Empty file.

0 comments on commit 0c24ae6

Please sign in to comment.