Skip to content

Commit 2e0231f

Browse files
authored
Merge pull request #172 from Call-for-Code-for-Racial-Justice/cevans-dockerdevenv
Local development environment via Docker
2 parents 5139003 + aaacdac commit 2e0231f

File tree

5 files changed

+214
-153
lines changed

5 files changed

+214
-153
lines changed

Dockerfile-devenv

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
FROM python:3.9.13-slim-buster
2+
3+
# Setup env
4+
ENV LANG C.UTF-8
5+
ENV LC_ALL C.UTF-8
6+
ENV PYTHONDONTWRITEBYTECODE 1
7+
ENV PYTHONFAULTHANDLER 1
8+
9+
# Install pipenv and compilation dependencies
10+
RUN pip install --no-cache-dir --upgrade pip==22.2.2 && \
11+
pip install --no-cache-dir pipenv==2022.8.24 gunicorn==20.1.0 django==4.1 django_bootstrap4==22.2 django_extensions==3.2.0 django-allow-cidr==0.5.0 django_q==1.3.9 psycopg2-binary==2.9.3 whitenoise==6.2.0 django-livesync==0.5
12+
13+
# Install python dependencies in /.venv
14+
WORKDIR /
15+
COPY Pipfile Pipfile.lock ./
16+
17+
RUN PIPENV_VENV_IN_PROJECT=1 pipenv install --deploy
18+
19+
# Create and switch to a new user
20+
RUN useradd --uid 1001 --gid 0 appuser
21+
WORKDIR /app
22+
ENV PATH="/.venv/bin:$PATH"
23+
24+
# Install application into container
25+
# COPY --chown=1001:0 . .
26+
# RUN chmod -R g=u .
27+
28+
USER appuser
29+
30+
EXPOSE 8080
31+
32+
CMD ["bash", "entrypoint-dev.sh"]

Pipfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ soupsieve = "==2.0.1"
2323
zipp = "==3.1.0"
2424
django-pdb = "==0.6.2"
2525
django-extensions = "==3.1.1"
26-
psycopg2-binary = "==2.8.6"
26+
psycopg2-binary = "==2.9.3"
2727
requests = "==2.25.1"
2828
ibm-watson = "==5.1.0"
2929
ibm-cos-sdk = "==2.9.0"
@@ -75,7 +75,7 @@ sphinxcontrib-serializinghtml = "==1.1.4"
7575
toml = "==0.10.2"
7676
tornado = "==6.1"
7777
tqdm = "==4.57.0"
78-
typed-ast = "==1.4.2"
78+
typed-ast = "==1.5.4"
7979
urllib3 = "==1.26.5"
8080
webencodings = "==0.5.1"
8181
wrapt = "==1.12.1"

0 commit comments

Comments
 (0)