diff --git a/Dockerfile b/Dockerfile index fe50d7d..858f6e7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,17 @@ -# Use an official Python runtime as a parent image -FROM python:3.10.11 +FROM pypy:3.10 + + +RUN apt-get update && apt-get install -y \ + curl \ + build-essential \ + libssl-dev \ + pkg-config \ + && rm -rf /var/lib/apt/lists/* + +RUN curl https://sh.rustup.rs -sSf | sh -s -- -y +ENV PATH="/root/.cargo/bin:${PATH}" +RUN rustc --version && cargo --version + # Set environment variables ENV PYTHONDONTWRITEBYTECODE 1 @@ -11,7 +23,6 @@ WORKDIR /usr/src/app RUN apt update && apt install gcc - # RUN apt-get update && \ # apt-get install -y --no-install-recommends \ # build-essential \ @@ -27,6 +38,7 @@ RUN pip install --upgrade pip COPY ./requirements.txt . RUN pip install -r requirements.txt +RUN ln -s /usr/local/bin/pypy3 /usr/local/bin/python # Copy project @@ -35,4 +47,4 @@ COPY ./start.sh . COPY ./celery.sh . -RUN python manage.py collectstatic --noinput +# RUN pypy3 manage.py collectstatic --noinput diff --git a/Dockerfile.prod b/Dockerfile.dev similarity index 59% rename from Dockerfile.prod rename to Dockerfile.dev index 858f6e7..fe50d7d 100644 --- a/Dockerfile.prod +++ b/Dockerfile.dev @@ -1,17 +1,5 @@ -FROM pypy:3.10 - - -RUN apt-get update && apt-get install -y \ - curl \ - build-essential \ - libssl-dev \ - pkg-config \ - && rm -rf /var/lib/apt/lists/* - -RUN curl https://sh.rustup.rs -sSf | sh -s -- -y -ENV PATH="/root/.cargo/bin:${PATH}" -RUN rustc --version && cargo --version - +# Use an official Python runtime as a parent image +FROM python:3.10.11 # Set environment variables ENV PYTHONDONTWRITEBYTECODE 1 @@ -23,6 +11,7 @@ WORKDIR /usr/src/app RUN apt update && apt install gcc + # RUN apt-get update && \ # apt-get install -y --no-install-recommends \ # build-essential \ @@ -38,7 +27,6 @@ RUN pip install --upgrade pip COPY ./requirements.txt . RUN pip install -r requirements.txt -RUN ln -s /usr/local/bin/pypy3 /usr/local/bin/python # Copy project @@ -47,4 +35,4 @@ COPY ./start.sh . COPY ./celery.sh . -# RUN pypy3 manage.py collectstatic --noinput +RUN python manage.py collectstatic --noinput diff --git a/docker-compose.yml b/docker-compose.yml index 8921d94..0e7a336 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,7 +4,7 @@ services: celery: platform: linux/arm64 - build: . + build: Dockerfile.dev command: celery -A witswin worker --beat --concurrency 1 -l INFO volumes: - ./src/:/usr/src/app