Skip to content

Commit

Permalink
Reverted Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
TreyWW authored Oct 20, 2024
1 parent 3362f38 commit 6a379b2
Showing 1 changed file with 19 additions and 13 deletions.
32 changes: 19 additions & 13 deletions infrastructure/backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,33 @@ ENV POETRY_NO_INTERACTION=1 \

WORKDIR /MyFinances

# Install build dependencies including C++ compiler
RUN apk add --no-cache --virtual .build-deps \
gcc \
g++ \
musl-dev \
libffi-dev \
mariadb-dev \
postgresql-dev \
curl

# Copy only dependency files first for better caching
#RUN #apk --no-cache --update add \
# mariadb-connector-c-dev \
# py-pip \
# musl-dev \
# gcc \
# mariadb-dev \
# libffi-dev


# Install build dependencies
RUN apk add --virtual .build-deps py-pip musl-dev gcc

COPY pyproject.toml poetry.lock ./

# 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 if TESTING is not true or DATABASE_TYPE is postgres
# 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 All @@ -41,4 +46,5 @@ RUN chmod +x infrastructure/backend/scripts/*

ENTRYPOINT ["sh", "infrastructure/backend/scripts/entrypoint.sh"]

EXPOSE 10012 9012
EXPOSE 10012
EXPOSE 9012

0 comments on commit 6a379b2

Please sign in to comment.