Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +7 -1
Dockerfile
CHANGED
|
@@ -54,9 +54,15 @@ RUN --mount=type=secret,id=GH_TOKEN,mode=0444,required=true \
|
|
| 54 |
git config --global user.email $(cat /run/secrets/GH_EMAIL) && \
|
| 55 |
git clone https://$(cat /run/secrets/GH_TOKEN)@github.com/$(cat /run/secrets/GH_USERNAME)/$(cat /run/secrets/REPO_NAME).git /home/coder/cpp_competition
|
| 56 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
# 暴露端口
|
| 58 |
EXPOSE 8080
|
| 59 |
EXPOSE 7860
|
| 60 |
|
| 61 |
# 将启动脚本设为容器入口
|
| 62 |
-
CMD ["code-server", "/home/coder/cpp_competition"]
|
|
|
|
| 54 |
git config --global user.email $(cat /run/secrets/GH_EMAIL) && \
|
| 55 |
git clone https://$(cat /run/secrets/GH_TOKEN)@github.com/$(cat /run/secrets/GH_USERNAME)/$(cat /run/secrets/REPO_NAME).git /home/coder/cpp_competition
|
| 56 |
|
| 57 |
+
# 配置git自动提交
|
| 58 |
+
COPY autocommit.sh /usr/local/scripts/autocommit.sh
|
| 59 |
+
RUN chmod +x /usr/local/scripts/autocommit.sh
|
| 60 |
+
RUN echo "30 2 */2 * * coder /bin/bash /usr/local/scripts/autocommit.sh" > /etc/cron.d/autocommit-cron
|
| 61 |
+
RUN chmod 0644 /etc/cron.d/autocommit-cron
|
| 62 |
+
|
| 63 |
# 暴露端口
|
| 64 |
EXPOSE 8080
|
| 65 |
EXPOSE 7860
|
| 66 |
|
| 67 |
# 将启动脚本设为容器入口
|
| 68 |
+
CMD ["cron", "&&", "code-server", "/home/coder/cpp_competition"]
|