Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 13 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
FROM alpine:3.10
LABEL maintainer "Wes Lambert, [email protected]"
LABEL version="Unfurl Docker v0.2"
FROM python:3.11-alpine
LABEL maintainer="Wes Lambert, [email protected]"
LABEL version="Unfurl Docker v0.4"
LABEL description="Run Unfurl in a Docker container"

COPY requirements.txt /unfurl/requirements.txt
COPY requirements-ui.txt /unfurl/requirements-ui.txt

RUN apk update && apk add --no-cache git python3 && \
if [ ! -e /usr/bin/pip ]; then ln -s pip3 /usr/bin/pip ; fi && \
if [[ ! -e /usr/bin/python ]]; then ln -sf /usr/bin/python3 /usr/bin/python; fi && \
pip3 install -r /unfurl/requirements.txt

COPY unfurl/ /unfurl/unfurl/
COPY *.py unfurl.ini /unfurl/
RUN sed -i 's/^host.*/host = 0.0.0.0/' /unfurl/unfurl.ini
RUN apk update && apk add --no-cache git wget && \
pip install --upgrade pip && \
pip install -r /unfurl/requirements.txt && \
pip install -r /unfurl/requirements-ui.txt

COPY . /unfurl/
WORKDIR /unfurl
ENTRYPOINT ["/usr/bin/python3", "unfurl_app.py"]
RUN pip install -e .

EXPOSE 5000
ENTRYPOINT ["python", "-c", "from unfurl.app import web_app; web_app()"]
18 changes: 16 additions & 2 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
version: '2'
services:
unfurl:
container_name: unfurl
build:
context: ./
dockerfile: Dockerfile
# Match the port defined in unfurl.ini
ports:
- "5000:5000"
restart: unless-stopped
environment:
- PYTHONUNBUFFERED=1
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:5000/"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
volumes:
- ./unfurl.ini:/unfurl/unfurl.ini:ro
networks:
- unfurl-network

networks:
unfurl-network:
driver: bridge
Loading