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

Commit

Permalink
updated readme
Browse files Browse the repository at this point in the history
added license

fixed docker build behavior
  • Loading branch information
alimaktabi committed Sep 17, 2024
1 parent 2e13a3f commit ac1ee3f
Show file tree
Hide file tree
Showing 7 changed files with 102 additions and 107 deletions.
146 changes: 75 additions & 71 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,103 +1,107 @@
# # Builder stage
# FROM pypy:3.10 AS builder
# Builder stage
FROM pypy:3.10 AS builder

# # Install dependencies for Rust and Python build requirements
# RUN apt-get update && apt-get install -y \
# curl \
# build-essential \
# libssl-dev \
# pkg-config \
# gcc \
# && rm -rf /var/lib/apt/lists/*
# Install dependencies for Rust and Python build requirements
RUN apt-get update && apt-get install -y \
curl \
build-essential \
libssl-dev \
pkg-config \
gcc \
&& rm -rf /var/lib/apt/lists/*

# # Install Rust and Cargo
# RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
# ENV PATH="/root/.cargo/bin:${PATH}"
# RUN rustc --version && cargo --version
# Install Rust and Cargo
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"
RUN rustc --version && cargo --version

# # Set work directory
# WORKDIR /usr/src/app
# Set work directory
WORKDIR /usr/src/app

# # Upgrade pip and install Python dependencies into a virtual environment
# RUN pip install --upgrade pip
# COPY ./requirements.txt .
# RUN pip install -r requirements.txt
# Upgrade pip and install Python dependencies into a virtual environment
RUN pip install --upgrade pip
COPY ./requirements.txt .
RUN pip install -r requirements.txt

# # Final stage (runtime)
# FROM pypy:3.10

# # Set environment variables
# ENV PYTHONDONTWRITEBYTECODE 1
# ENV PYTHONUNBUFFERED 1
# Final stage (runtime)
FROM pypy:3.10

# # Set work directory
# WORKDIR /usr/src/app
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1

# Set work directory
WORKDIR /usr/src/app

# # Install GCC
# RUN apt update && apt install -y gcc
# Install GCC
RUN apt update && apt install -y gcc

# # Copy installed Python packages from builder stage
# COPY --from=builder /opt/pypy/lib/pypy3.10/ /opt/pypy/lib/pypy3.10/
# Copy installed Python packages from builder stage
COPY --from=builder /opt/pypy/lib/pypy3.10/ /opt/pypy/lib/pypy3.10/
COPY --from=builder /opt/pypy/lib/pypy3.10/ /opt/pypy/lib/python3.8/
# this depends on what you are installing
COPY --from=builder /usr/local/bin /usr/local/bin

# # Link pypy3 to python
# Link pypy3 to python
# RUN ln -s /usr/local/bin/pypy3 /usr/local/bin/python

# # Copy project files
# COPY ./src .
# COPY ./start.sh .
# COPY ./celery.sh .
# Copy project files
COPY ./src .
COPY ./start.sh .
COPY ./celery.sh .

# # RUN pypy3 manage.py collectstatic --noinput
# RUN pypy3 manage.py collectstatic --noinput



FROM pypy:3.10
# 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 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
# 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
ENV PYTHONUNBUFFERED 1
# # Set environment variables
# ENV PYTHONDONTWRITEBYTECODE 1
# ENV PYTHONUNBUFFERED 1

# Set work directory
WORKDIR /usr/src/app
# # Set work directory
# WORKDIR /usr/src/app

RUN apt update && apt install gcc
# RUN apt update && apt install gcc


# RUN apt-get update && \
# apt-get install -y --no-install-recommends \
# build-essential \
# gcc \
# libpq-dev \
# libc-dev \
# netcat-traditional \
# && apt-get clean && \
# rm -rf /var/lib/apt/lists/*
# # RUN apt-get update && \
# # apt-get install -y --no-install-recommends \
# # build-essential \
# # gcc \
# # libpq-dev \
# # libc-dev \
# # netcat-traditional \
# # && apt-get clean && \
# # rm -rf /var/lib/apt/lists/*


RUN pip install --upgrade pip
COPY ./requirements.txt .
RUN pip install -r requirements.txt
# 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
# RUN ln -s /usr/local/bin/pypy3 /usr/local/bin/python


# Copy project
COPY ./src .
COPY ./start.sh .
COPY ./celery.sh .
# # Copy project
# COPY ./src .
# COPY ./start.sh .
# COPY ./celery.sh .


# RUN pypy3 manage.py collectstatic --noinput
# # RUN pypy3 manage.py collectstatic --noinput
20 changes: 20 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Copyright (c)

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
31 changes: 1 addition & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,6 @@ We welcome contributions from developers, designers, and anyone interested in im
* Submit a pull request to the main repository.
* Ensure your code follows the project's coding standards and guidelines.

### 3. Translating the Project

* If you'd like to translate the project into your language, create a new issue on the GitHub issue tracker.
* We'll provide guidance on how to proceed with the translation.

### 4. Providing Feedback

* Share your thoughts on the project's features, user experience, and overall direction.
* Create a new issue on the GitHub issue tracker or email us at [insert email].

## Getting Started
---------------

Expand Down Expand Up @@ -89,23 +79,4 @@ PRIVY_JWKS_URL=""

```
docker compose up
```



## License
-------

The project is licensed under the MIT License. See the LICENSE file for more information.

<!-- ## Acknowledgments
---------------
We'd like to thank the following contributors for their help and support:
* [Insert names] -->

## Contact Us
------------

If you have any questions, suggestions, or feedback, please don't hesitate to contact us at [email protected].
```
2 changes: 1 addition & 1 deletion celery.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/sh

celery -A witswin worker --beat --concurrency 1 -l INFO
pypy3 -m celery -A witswin worker --beat --concurrency 1 -l INFO
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ services:
context: .
dockerfile: Dockerfile.dev

command: pypy manage.py runserver 0.0.0.0:4444
command: python manage.py runserver 0.0.0.0:4444
environment:
- FIELD_KEY=${FIELD_KEY}
- SECRET_KEY=${SECRET_KEY}
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ python-dotenv==0.20.0
python-memcached==1.59
# sentry-sdk==1.5.12
web3==6.9.0
whitenoise==6.1.0
coverage~=7.3.2
pytz~=2023.3.post1
requests>=2.32.0
Expand All @@ -31,4 +30,5 @@ channels[daphne]==4.1
channels_redis==4.2
django-cloudflare-images~=0.6.0
python-decouple==3.8
psycopg[binary]==3.2.2
psycopg[binary]==3.2.2
whitenoise[gzip]==6.1.0
4 changes: 2 additions & 2 deletions start.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
python manage.py migrate
pypy3 manage.py migrate

daphne -b 0.0.0.0 -p ${PORT:-5000} witswin.asgi:application
pypy3 -m daphne -b 0.0.0.0 -p ${PORT:-5000} witswin.asgi:application

0 comments on commit ac1ee3f

Please sign in to comment.