Skip to content

Commit

Permalink
Update Dockerfile to work with ARM too
Browse files Browse the repository at this point in the history
  • Loading branch information
TreyWW authored Oct 20, 2024
1 parent 4b18377 commit 35873f2
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions infrastructure/backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.12-alpine
FROM --platform=$BUILDPLATFORM python:3.12-alpine

RUN pip install poetry==1.7.1

Expand All @@ -9,33 +9,25 @@ ENV POETRY_NO_INTERACTION=1 \

WORKDIR /MyFinances

#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
RUN apk add --no-cache --virtual .build-deps \
musl-dev \
gcc \
g++ \
libffi-dev \
openssl-dev

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 && \
apk add --no-cache mariadb-connector-c-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 35873f2

Please sign in to comment.