25 lines
677 B
Docker
25 lines
677 B
Docker
FROM python:3.8-alpine
|
|
|
|
# hadolint ignore=DL3018
|
|
RUN apk add --no-cache postgresql-libs gettext zlib libjpeg libxml2-dev libxslt-dev
|
|
ENV PYTHONUNBUFFERED 1
|
|
EXPOSE 8080
|
|
|
|
# Don't run container as root
|
|
RUN adduser -D recipes
|
|
|
|
RUN mkdir /opt/recipes
|
|
RUN chown recipes:recipes /opt/recipes
|
|
WORKDIR /opt/recipes
|
|
COPY --chown=recipes:recipes . ./
|
|
RUN pwd && ls -lha
|
|
RUN chmod +x boot.sh
|
|
|
|
# hadolint ignore=DL3018
|
|
RUN apk add --no-cache --virtual .build-deps gcc musl-dev postgresql-dev zlib-dev jpeg-dev && \
|
|
python -m venv venv && \
|
|
venv/bin/pip install -r requirements.txt --no-cache-dir &&\
|
|
apk --purge del .build-deps
|
|
|
|
USER recipes
|
|
ENTRYPOINT ["/opt/recipes/boot.sh"] |