Skip to content

Commit ebf75a7

Browse files
authored
Docker lite. (#176)
1 parent 9eb87c3 commit ebf75a7

File tree

3 files changed

+62
-2
lines changed

3 files changed

+62
-2
lines changed

.github/workflows/build_docker.yml renamed to .github/workflows/build_docker_full.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build and push Docker image
1+
name: Build and push Docker image [FULL]
22

33
on:
44
release:
@@ -17,7 +17,7 @@ jobs:
1717
with:
1818
script: |
1919
const wait = (ms) => new Promise(resolve => setTimeout(resolve, ms));
20-
await wait(300000); // Wait for 5 minutes (300000 milliseconds)
20+
await wait(300000); // Wait for 5 minutes
2121
2222
- name: Login to DockerHub
2323
uses: docker/login-action@v2
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Build and push Docker image [LITE]
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
build:
9+
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v2
14+
15+
- name: Wait until PyPI release is available
16+
uses: actions/github-script@v3
17+
with:
18+
script: |
19+
const wait = (ms) => new Promise(resolve => setTimeout(resolve, ms));
20+
await wait(180000); // Wait for 3 minutes
21+
22+
- name: Login to DockerHub
23+
uses: docker/login-action@v2
24+
with:
25+
username: ${{ secrets.DOCKERHUB_USERNAME }}
26+
password: ${{ secrets.DOCKERHUB_TOKEN }}
27+
28+
- name: Build and push Docker image
29+
uses: docker/build-push-action@v4
30+
with:
31+
context: .
32+
push: true
33+
tags: |
34+
iwatkot/maps4fs:${{ github.ref_name }}_lite
35+
file: ./Dockerfile_lite

Dockerfile_lite

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
FROM python:3.11-slim-buster
2+
3+
# Dependencies for opencv.
4+
RUN apt-get update && apt-get install -y \
5+
libgl1-mesa-dev \
6+
libglib2.0-0
7+
8+
WORKDIR /usr/src/app
9+
10+
COPY .streamlit /usr/src/app/.streamlit
11+
COPY data /usr/src/app/data
12+
COPY docs /usr/src/app/docs
13+
COPY webui /usr/src/app/webui
14+
COPY requirements.txt /usr/src/app/requirements.txt
15+
16+
RUN pip install -r requirements.txt
17+
18+
# Ensure the latest version of maps4fs is installed.
19+
RUN pip install --upgrade maps4fs
20+
21+
EXPOSE 8501
22+
23+
ENV PYTHONPATH .:${PYTHONPATH}
24+
ENV LITEVERSION True
25+
CMD ["streamlit", "run", "./webui/webui.py"]

0 commit comments

Comments
 (0)