소스 검색

activating swap on fly.io

Rodja Trappe 1 년 전
부모
커밋
ffa484b125
3개의 변경된 파일7개의 추가작업 그리고 5개의 파일을 삭제
  1. 2 0
      fly-entrypoint.sh
  2. 2 2
      fly.dockerfile
  3. 3 3
      fly.toml

+ 2 - 0
fly-entrypoint.sh

@@ -7,4 +7,6 @@ if [[ ! -z "$SWAP" ]]; then
   swapon _swapfile
   swapon _swapfile
 fi
 fi
 
 
+free -hm
+df -h
 exec "$@"
 exec "$@"

+ 2 - 2
fly.dockerfile

@@ -2,9 +2,9 @@ FROM python:3.11.3-slim
 
 
 LABEL maintainer="Zauberzeug GmbH <nicegui@zauberzeug.com>"
 LABEL maintainer="Zauberzeug GmbH <nicegui@zauberzeug.com>"
 
 
-RUN pip install itsdangerous prometheus_client isort docutils pandas plotly matplotlib requests
+RUN apt update && apt install -y curl procps
 
 
-RUN apt update && apt install -y curl 
+RUN pip install itsdangerous prometheus_client isort docutils pandas plotly matplotlib requests
 
 
 RUN curl -sSL https://install.python-poetry.org | python3 - && \
 RUN curl -sSL https://install.python-poetry.org | python3 - && \
     cd /usr/local/bin && \
     cd /usr/local/bin && \

+ 3 - 3
fly.toml

@@ -8,9 +8,6 @@ primary_region = "fra"
 kill_signal = "SIGTERM"
 kill_signal = "SIGTERM"
 kill_timeout = "5s"
 kill_timeout = "5s"
 
 
-[experimental]
-  auto_rollback = true
-
 [build]
 [build]
   dockerfile = "fly.dockerfile"
   dockerfile = "fly.dockerfile"
 
 
@@ -20,6 +17,9 @@ kill_timeout = "5s"
 [processes]
 [processes]
   app = ""
   app = ""
 
 
+[env]
+  SWAP = "true"
+
 [[services]]
 [[services]]
   protocol = "tcp"
   protocol = "tcp"
   internal_port = 8080
   internal_port = 8080