Skip to content

Commit a6f0fb2

Browse files
committed
chore: update Dockerfile
1 parent eeb77dc commit a6f0fb2

1 file changed

Lines changed: 9 additions & 13 deletions

File tree

Dockerfile

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,13 @@ WORKDIR $PYSETUP_PATH
1212

1313
COPY pyproject.toml poetry.lock ./
1414

15-
RUN $POETRY_HOME/bin/poetry install --no-root
15+
RUN $POETRY_HOME/bin/poetry install --without=dev --no-root
1616

1717
FROM base as dev
1818

19-
WORKDIR /app
20-
2119
ARG UID=10001
2220
ARG GID=10001
2321

24-
2522
COPY scripts/install_nodejs.sh /opt/
2623
RUN apt-get update; \
2724
apt-get install -y \
@@ -35,13 +32,17 @@ RUN apt-get update; \
3532
rm -rf /var/lib/apt/lists/*
3633

3734
ENV PORT=8000 \
38-
PATH=/opt/pysetup/.venv/bin:$PATH \
39-
VENV_PATH=/opt/pysetup/.venv
35+
PATH=/opt/pysetup/.venv/bin:$PATH
4036

4137
RUN groupadd -g $GID app; \
4238
useradd -d /app -g $GID -u $UID -M -s /usr/bin/zsh app; \
43-
chown -R app:app /app
39+
mkdir -p /app; \
40+
chown app:app /app
41+
42+
RUN $POETRY_HOME/bin/poetry install --no-root
43+
4444
USER app
45+
WORKDIR /app
4546

4647
COPY --chown=app:app . .
4748

@@ -62,19 +63,14 @@ RUN apt-get update; \
6263

6364
ENV PORT=8000 \
6465
PATH=/opt/pysetup/.venv/bin:$PATH \
65-
POETRY_HOME=/opt/poetry \
6666
VENV_PATH=/opt/pysetup/.venv
6767

68-
COPY --from=base $POETRY_HOME $POETRY_HOME
6968
COPY --from=base $VENV_PATH $VENV_PATH
70-
COPY pyproject.toml poetry.lock ./
71-
72-
RUN $POETRY_HOME/bin/poetry install --no-dev --no-root
7369

7470
RUN groupadd -g $GID app; \
7571
useradd -g $GID -u $UID -M -s /bin/bash app; \
7672
mkdir -p /app; \
77-
chown -R app:app /app
73+
chown app:app /app
7874

7975
USER app
8076
WORKDIR /app

0 commit comments

Comments
 (0)