Skip to content

Commit

Permalink
Merge pull request #20 from cr0hn/improve/smaller-image-size
Browse files Browse the repository at this point in the history
Improve/smaller image size [skip CI]
  • Loading branch information
zhukovgreen committed Apr 3, 2020
2 parents 08c9c5c + 34bc43f commit 0542408
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
7 changes: 5 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
FROM python:3.8 as base
FROM python:3.8-alpine as base

FROM base as install-poetry
RUN pip install poetry
RUN apk add --no-cache gcc musl-dev
RUN wget -O - https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python
ENV PATH="/root/.local/bin:/root/.poetry/bin:${PATH}"

FROM install-poetry as install-deps
WORKDIR /aiohttp-cache
COPY ./pyproject.toml .
COPY ./poetry.lock .

RUN poetry install

FROM install-deps as copy-src
Expand Down
9 changes: 1 addition & 8 deletions aiohttp_cache/backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,11 @@
import enum
import pickle
import time
import warnings
from _sha256 import sha256 # noqa
from typing import Tuple # noqa

import aiohttp.web

try:
import aioredis
except ImportError:
warnings.showwarning(
"aioredis library not found. Redis cache backend not available"
)
import aioredis


class AvailableKeys(enum.Enum):
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ services:
redis:
image: "redis:5.0.7"
ports:
- "63790:6379"
- "6379:6379"

0 comments on commit 0542408

Please sign in to comment.