forked from openfun/richie
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(docker): configure project to use docker in development
This commit refactors the project to enable running it in Docker for development.
- Loading branch information
Samuel Paccoud - FUN MOOC
committed
Jan 5, 2018
1 parent
c2aa724
commit 9f389f6
Showing
9 changed files
with
158 additions
and
137 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,6 @@ | ||
Dockerfile | ||
Pipefile | ||
nginx/ | ||
media/ | ||
*.db | ||
*.md |
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,20 @@ | ||
FROM python:3.6-stretch | ||
WORKDIR /app | ||
ENV LC_ALL C.UTF-8 | ||
ENV LANG C.UTF-8 | ||
|
||
# Add repository to install the connector to postgresql 9.6 | ||
# Remove the package lists after installation as a good practice | ||
RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main' > /etc/apt/sources.list.d/pgdg.list && \ | ||
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - && \ | ||
apt-get update && \ | ||
apt-get install -y python3-dev postgresql-server-dev-9.6 && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Start by adding only the pipfile so that the next layer with all | ||
# Python installs does not change each time our code changes | ||
ADD Pipfile.lock /app/Pipfile.lock | ||
RUN pip install pipenv && pipenv install --ignore-pipfile | ||
|
||
ADD . /app | ||
|
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
version: "3" | ||
services: | ||
nginx: | ||
build: ./nginx | ||
image: fun_cms-nginx | ||
ports: | ||
- "8080:80" | ||
db: | ||
image: postgres:9.6 | ||
ports: | ||
- "5440:5432" | ||
environment: | ||
POSTGRES_USER: "fun" | ||
POTGRES_PASSWORD: "pass" | ||
app: | ||
build: ./ | ||
image: fun_cms-app | ||
environment: | ||
DATABASE_HOST: "db" | ||
DATABASE_USER: "fun" | ||
DATABASE_PASSWORD: "pass" | ||
command: bash -c "pipenv run python 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
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,3 @@ | ||
FROM nginx:1.12.2 | ||
ADD conf.d /etc/nginx/conf.d | ||
ADD static /app |
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,19 @@ | ||
server { | ||
|
||
listen 80; | ||
server_name localhost; | ||
charset utf-8; | ||
|
||
location /static { | ||
alias /app; | ||
} | ||
|
||
location / { | ||
proxy_pass http://app:8000; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
} | ||
|
||
} | ||
|
This file was deleted.
Oops, something went wrong.