-
-
Notifications
You must be signed in to change notification settings - Fork 181
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #156 from furious-luke/chore/dockerize-example-site
🔨 Dockerize example site
- Loading branch information
Showing
12 changed files
with
315 additions
and
78 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
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
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
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 |
---|---|---|
|
@@ -11,4 +11,6 @@ media | |
dist/ | ||
*.egg-info/ | ||
.idea | ||
.DS_Store | ||
.DS_Store | ||
|
||
.envrc |
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,41 @@ | ||
FROM python:3.9-slim | ||
LABEL maintainer="[email protected]" | ||
|
||
ENV PYTHONDONTWRITEBYTECODE=1 \ | ||
PYTHONUNBUFFERED=1 \ | ||
PYTHONIOENCODING=utf-8 \ | ||
LANG=C.UTF-8 | ||
|
||
RUN apt-get -qq update \ | ||
&& apt-get -y install \ | ||
bash \ | ||
locales \ | ||
git \ | ||
build-essential \ | ||
libssl-dev \ | ||
&& pip install poetry \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
&& ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime \ | ||
&& locale-gen C.UTF-8 || true | ||
|
||
ARG USER_ID | ||
ARG GROUP_ID | ||
RUN addgroup --gid $GROUP_ID user || true \ | ||
&& useradd -M -u $USER_ID -g $GROUP_ID user || true \ | ||
&& usermod -d /code user || true | ||
|
||
RUN mkdir -p /code | ||
WORKDIR /code | ||
|
||
COPY ./example_site/pyproject.toml ./example_site/poetry.lock /code/ | ||
RUN poetry config virtualenvs.create false \ | ||
&& poetry install --no-interaction --no-ansi | ||
|
||
COPY ./example_site /code/ | ||
COPY ./address /code/address | ||
RUN chown -R user:user /code | ||
USER user | ||
|
||
EXPOSE 8000 | ||
|
||
CMD ./manage.py migrate && ./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,31 @@ | ||
version: "3" | ||
services: | ||
|
||
db: | ||
image: postgres:13-alpine | ||
environment: | ||
- DATABASE_URL=postgres://postgres:postgres@localhost/postgres | ||
- POSTGRES_PASSWORD=postgres | ||
ports: | ||
- "5432:5432" | ||
restart: unless-stopped | ||
|
||
server: | ||
build: | ||
context: . | ||
dockerfile: ./Dockerfile | ||
args: | ||
- USER_ID | ||
- GROUP_ID | ||
environment: | ||
- DATABASE_URL=psql://postgres:postgres@db/postgres | ||
- GOOGLE_API_KEY | ||
volumes: | ||
- ./address:/code/address | ||
ports: | ||
- "8000:8000" | ||
depends_on: | ||
- db | ||
restart: unless-stopped | ||
stdin_open: true | ||
tty: true |
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
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.