Skip to content
This repository has been archived by the owner on Sep 25, 2024. It is now read-only.

Commit

Permalink
fixed build dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
alimaktabi committed Sep 16, 2024
1 parent 537b73b commit e80e6d5
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 21 deletions.
20 changes: 16 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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 \
Expand All @@ -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
Expand All @@ -35,4 +47,4 @@ COPY ./start.sh .
COPY ./celery.sh .


RUN python manage.py collectstatic --noinput
# RUN pypy3 manage.py collectstatic --noinput
20 changes: 4 additions & 16 deletions Dockerfile.prod → Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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 \
Expand All @@ -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
Expand All @@ -47,4 +35,4 @@ COPY ./start.sh .
COPY ./celery.sh .


# RUN pypy3 manage.py collectstatic --noinput
RUN python manage.py collectstatic --noinput
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e80e6d5

Please sign in to comment.