forked from lpoaura/GN2PG
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
40 lines (25 loc) · 788 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
FROM python:3.10-slim-buster as base
LABEL maintainer="@lpofredc"
# Keeps Python from generating .pyc files in the container
ENV PYTHONDONTWRITEBYTECODE=1
# Turns off buffering for easier container logging
ENV PYTHONUNBUFFERED=1
RUN apt-get update && apt-get -y upgrade && \
apt-get install -y libpq-dev
FROM base as builder
WORKDIR /app
COPY pyproject.toml poetry.lock ./
# Install Poetry
RUN pip install poetry
COPY . .
RUN poetry install
RUN poetry build
FROM base as final
RUN groupadd -r -g 1000 xfer && useradd --no-log-init -r -g 1000 -d /home/xfer -m -u 1000 xfer && \
chown -R xfer /home/xfer
COPY --from=builder /app/dist/*.whl /tmp/
RUN pip install /tmp/*.whl
USER xfer
RUN mkdir /home/xfer/.gn2pg
VOLUME [ "/home/xfer/.gn2pg" ]
ENTRYPOINT ["gn2pg_cli"]