-
Notifications
You must be signed in to change notification settings - Fork 409
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4b79c2f
commit 60f2643
Showing
5 changed files
with
90 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
FROM python:3.8 | ||
ENV PYTHONUNBUFFERED 1 | ||
|
||
RUN rm /var/lib/dpkg/info/format | ||
RUN printf "1\n" > /var/lib/dpkg/info/format | ||
RUN dpkg --configure -a | ||
RUN apt-get clean && apt-get update \ | ||
&& apt-get install -y --no-install-recommends \ | ||
postgresql-client \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
&& apt-get purge -y --auto-remove gcc | ||
|
||
RUN pip install pipenv | ||
RUN mkdir /app | ||
WORKDIR /app | ||
|
||
COPY src/ /app/ | ||
COPY bin/ /app/bin/ | ||
COPY Pipfile* /app/ | ||
|
||
RUN pipenv install | ||
ENV DJANGO_SETTINGS_MODULE=app.settings.master-docker | ||
EXPOSE 8000 | ||
|
||
CMD ["./bin/docker"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
FROM python:3.8 | ||
ENV PYTHONUNBUFFERED 1 | ||
|
||
RUN rm /var/lib/dpkg/info/format | ||
RUN printf "1\n" > /var/lib/dpkg/info/format | ||
RUN dpkg --configure -a | ||
RUN apt-get clean && apt-get update \ | ||
&& apt-get install -y --no-install-recommends \ | ||
postgresql-client \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
&& apk add --no-cache --virtual .build-deps gcc musl-dev | ||
|
||
RUN pip install pipenv | ||
RUN mkdir /app | ||
WORKDIR /app | ||
|
||
COPY src/ /app/ | ||
COPY bin/ ./bin/ | ||
COPY Pipfile* /app/ | ||
|
||
RUN pipenv install | ||
ENV DJANGO_SETTINGS_MODULE=app.settings.master-docker | ||
EXPOSE 8000 | ||
|
||
CMD ["./bin/docker-dev"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
pipenv run python /app/src/manage.py migrate | ||
pipenv run python src/manage.py runserver 0.0.0.0:8000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
pipenv run python src/manage.py migrate | ||
pipenv run python src/manage.py runserver 0.0.0.0:8000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
version: '3' | ||
services: | ||
db: | ||
image: postgres | ||
container_name: db | ||
environment: | ||
POSTGRES_DB: bullettrain | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: password | ||
ports: | ||
- "5432:5432" | ||
api: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile.dev | ||
command: ./bin/docker-dev | ||
volumes: | ||
- .:/app | ||
environment: | ||
DJANGO_DB_NAME: bullettrain | ||
DJANGO_DB_USER: postgres | ||
DJANGO_DB_PASSWORD: password | ||
DJANGO_DB_PORT: 5432 | ||
DJANGO_ALLOWED_HOSTS: localhost | ||
ports: | ||
- "8000:8000" | ||
depends_on: | ||
- db | ||
links: | ||
- db:db |