Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEAT] merge prod and dev Dockerfile #1194

Merged
merged 8 commits into from
May 14, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
optimize Dockefile
  • Loading branch information
mhsiungw committed May 7, 2024
commit 06c7bdf741ca6a974220ee6b02b7e06f0d38d190
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@ RUN apt-get update
RUN apt-get install python-pip -y

RUN npm install -g yarn
RUN yarn install --dev --frozen-lockfile
RUN yarn install --dev --frozen-lockfile && yarn cache clean

FROM python_base as python_dependencies

ENV PYTHONUNBUFFERED=1 \
mattwang44 marked this conversation as resolved.
Show resolved Hide resolved
PYTHONDONTWRITEBYTECODE=1 \
PIP_DISABLE_PIP_VERSION_CHECK=on \
PIP_DEFAULT_TIMEOUT=100 \
POETRY_HOME="/opt/poetry" \
Expand All @@ -30,6 +29,7 @@ ENV APP_DIR $BASE_DIR/app
# Infrastructure tools
# gettext is used for django to compile .po to .mo files.
mattwang44 marked this conversation as resolved.
Show resolved Hide resolved
RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get install -y \
libpq-dev \
gcc \
Expand All @@ -46,7 +46,7 @@ RUN pip install --no-cache-dir pip==23.3.2 && \

# Install Python dependencies
COPY pyproject.toml poetry.lock ./
RUN poetry install --no-root && \
RUN poetry install --no-root --only main && \
yes | poetry cache clear --all pypi

# Add poetry bin directory to PATH
Expand All @@ -59,6 +59,7 @@ COPY --from=node_dependencies /usr/local/bin/node /usr/local/bin/node
ENV NODE_PATH $APP_DIR/node_modules/

FROM python_dependencies as dev
RUN poetry install --no-root --only dev


FROM python_dependencies as prod
Expand Down
Loading