Skip to content
This repository has been archived by the owner on Nov 29, 2024. It is now read-only.

Commit

Permalink
change back to docker and optimize image && serve static files from f…
Browse files Browse the repository at this point in the history
…ly.io
  • Loading branch information
Nickwasused committed Mar 29, 2024
1 parent 7ce7f7c commit b73e47f
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 17 deletions.
14 changes: 7 additions & 7 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# flyctl launch added from .gitignore
**\.idea

# flyctl launch added from .idea\.gitignore
# Default ignored files
.idea\shelf
.idea\workspace.xml
.*
fly.toml
Dockerfile
README.md
.gitkeep
/data/fuel.json
/data/facilities.json
venv/
11 changes: 4 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
FROM python:3.12-slim-bullseye
FROM python:alpine3.19

WORKDIR /app

COPY requirements.txt requirements.txt
RUN pip3 install -r requirements.txt

COPY . .
RUN pip install --no-cache-dir --no-input -r requirements.txt
RUN rm /app/requirements.txt
ENV TZ=Europe/Berlin
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

COPY . .

EXPOSE 5000

CMD [ "python3", "app.py", "-w"]
24 changes: 21 additions & 3 deletions fly.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,25 @@ primary_region = "ams"
[http_service]
internal_port = 5000
force_https = true
auto_stop_machines = false
auto_start_machines = false
min_machines_running = 1
auto_stop_machines = true
auto_start_machines = true
min_machines_running = 0
processes = ["app"]

[[http_service.checks]]
grace_period = "10s"
interval = "30s"
method = "GET"
timeout = "5s"
path = "/"

[[vm]]
size = "shared-cpu-1x"
memory = "256mb"
cpus = 1



[[statics]]
guest_path = "/app/public"
url_prefix = "/static"

0 comments on commit b73e47f

Please sign in to comment.