Skip to content

Commit

Permalink
Run postgres no matter what unless you specify not to
Browse files Browse the repository at this point in the history
  • Loading branch information
TreyWW committed Feb 12, 2024
1 parent bfa5800 commit 253b36c
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions infrastructure/backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,23 @@ COPY . .
# libffi-dev


RUN apk add --no-cache --virtual .build-deps py-pip musl-dev gcc \
&& if [ "${DATABASE_TYPE}" = "mysql" ]; then \
apk add --no-cache mariadb-dev \
&& poetry install --only mysql; \
elif ["${TESTING}" != "true"] || ["${DATABASE_TYPE}" = "postgres"]; then \
apk add --no-cache postgresql-dev \
&& poetry install --only postgres; \
fi \
&& apk del .build-deps
# Install build dependencies
RUN apk add --no-cache --virtual .build-deps py-pip musl-dev gcc

# Install MySQL dependencies and packages if DATABASE_TYPE is mysql
RUN if [ "${DATABASE_TYPE}" = "mysql" ]; then \
apk add --no-cache mariadb-dev && \
poetry install --only mysql; \
fi

# Install PostgreSQL dependencies and packages if TESTING is not true or DATABASE_TYPE is postgres
RUN if [ "${TESTING}" != "true" ] || [ "${DATABASE_TYPE}" = "postgres" ]; then \
apk add --no-cache postgresql-dev && \
poetry install --only postgres; \
fi

# Clean up build dependencies
RUN apk del .build-deps

RUN poetry install --without dev,mysql,postgres --no-root && rm -rf $POETRY_CACHE_DIR

Expand Down

0 comments on commit 253b36c

Please sign in to comment.