GithubHelp home page GithubHelp logo

raccoonyy / django-sample-for-docker-compose Goto Github PK

View Code? Open in Web Editor NEW
58.0 3.0 37.0 34 KB

django sample project for docker compose setup

Python 95.51% Dockerfile 4.49%
docker docker-compose django python

django-sample-for-docker-compose's Introduction

도커 컴포즈 설정을 위한 파이썬/Django 샘플 프로젝트

요약

$ git clone https://github.com/raccoonyy/django-sample-for-docker-compose.git
$ cd django-sample-for-docker-compose
$ docker-compose up

요구조건

  • 도커 엔진 : 1.12.0 이상
  • 도커 컴포즈 : 1.6.0 이상

실행

  1. 저장소 클론
$ git clone https://github.com/raccoonyy/django-sample-for-docker-compose.git
  1. 소스 디렉터리로 이동
$ cd django-sample-for-docker-compose
  1. 컴포즈로 서비스 실행
$ docker-compose up

도커 컴포즈 구성

  • docker-compose.yml

도커 컴포즈 명령(docker-compose) 실행시 참고하는 설정 모음

  • compose/django/Dockerfile-dev

개발용 컨테이너를 만들기 위한 Dockerfile (배포용 Dockerfile과 살짝 다름)

django-sample-for-docker-compose's People

Contributors

aciddust avatar raccoonyy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

django-sample-for-docker-compose's Issues

[help wanted] apt-utils 문제

안녕하세요.

docker tutorial을 따라해 보려고 하다가 에러가 나서 질문 드립니다.

에러는 다음과 같습니다.

PS E:\repo\django-sample-for-docker-compose> docker-compose up
Building django
Step 1/6 : FROM python:3
 ---> a4cc999cf2aa
Step 2/6 : ENV PYTHONUNBUFFERED 0
 ---> Running in 95f6a33f54c6
Removing intermediate container 95f6a33f54c6
 ---> 05812d73cf17
Step 3/6 : RUN apt-get update && apt-get -y install     libpq-dev
 ---> Running in 125b5c17255c
Ign:1 http://deb.debian.org/debian stretch InRelease
Get:2 http://deb.debian.org/debian stretch-updates InRelease [91.0 kB]
Get:3 http://deb.debian.org/debian stretch Release [118 kB]
Get:4 http://deb.debian.org/debian stretch Release.gpg [2434 B]
Get:5 http://deb.debian.org/debian stretch-updates/main amd64 Packages [27.2 kB]
Get:6 http://deb.debian.org/debian stretch/main amd64 Packages [7082 kB]
Gracefully stopping... (press Ctrl+C again to force)
PS E:\repo\django-sample-for-docker-compose> ^C
PS E:\repo\django-sample-for-docker-compose> ^C
PS E:\repo\django-sample-for-docker-compose> .\deldocker.bat

E:\repo\django-sample-for-docker-compose>docker stop django-sample-for-docker-compose_db_1
Error response from daemon: No such container: django-sample-for-docker-compose_db_1

E:\repo\django-sample-for-docker-compose>docker rm django-sample-for-docker-compose_db_1
Error: No such container: django-sample-for-docker-compose_db_1

E:\repo\django-sample-for-docker-compose>docker rm django-sample-for-docker-compose_django_1
Error: No such container: django-sample-for-docker-compose_django_1

E:\repo\django-sample-for-docker-compose>docker rmi -f django-sample-for-docker-compose_django
Error: No such image: django-sample-for-docker-compose_django
PS E:\repo\django-sample-for-docker-compose> docker-compose up
Building django
Step 1/6 : FROM python:3
 ---> a4cc999cf2aa
Step 2/6 : ENV PYTHONUNBUFFERED 0
 ---> Using cache
 ---> 05812d73cf17
Step 3/6 : RUN apt-get update && apt-get -y install     libpq-dev
 ---> Running in 3cadb0ec1c4e
Get:1 http://security.debian.org/debian-security stretch/updates InRelease [94.3 kB]
Get:2 http://security.debian.org/debian-security stretch/updates/main amd64 Packages [492 kB]
Ign:3 http://deb.debian.org/debian stretch InRelease
Get:4 http://deb.debian.org/debian stretch-updates InRelease [91.0 kB]
Get:5 http://deb.debian.org/debian stretch Release [118 kB]
Get:6 http://deb.debian.org/debian stretch-updates/main amd64 Packages [27.2 kB]
Get:7 http://deb.debian.org/debian stretch Release.gpg [2434 B]
Get:8 http://deb.debian.org/debian stretch/main amd64 Packages [7082 kB]
Fetched 7907 kB in 5s (1355 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
The following additional packages will be installed:
  libpq5
Suggested packages:
  postgresql-doc-9.6
The following packages will be upgraded:
  libpq-dev libpq5
2 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
Need to get 352 kB of archives.
After this operation, 2048 B of additional disk space will be used.
Get:1 http://security.debian.org/debian-security stretch/updates/main amd64 libpq-dev amd64 9.6.13-0+deb9u1 [216 kB]
Get:2 http://security.debian.org/debian-security stretch/updates/main amd64 libpq5 amd64 9.6.13-0+deb9u1 [136 kB]
debconf: delaying package configuration, since apt-utils is not installed
Fetched 352 kB in 1s (300 kB/s)
(Reading database ... 30576 files and directories currently installed.)
Preparing to unpack .../libpq-dev_9.6.13-0+deb9u1_amd64.deb ...
Unpacking libpq-dev (9.6.13-0+deb9u1) over (9.6.12-0+deb9u1) ...
Preparing to unpack .../libpq5_9.6.13-0+deb9u1_amd64.deb ...
Unpacking libpq5:amd64 (9.6.13-0+deb9u1) over (9.6.12-0+deb9u1) ...
Setting up libpq5:amd64 (9.6.13-0+deb9u1) ...
Processing triggers for libc-bin (2.24-11+deb9u4) ...
Setting up libpq-dev (9.6.13-0+deb9u1) ...
Removing intermediate container 3cadb0ec1c4e
 ---> 4a68520d2b81
Step 4/6 : WORKDIR /app
 ---> Running in d98a0d72c626
Removing intermediate container d98a0d72c626
 ---> f12d8af82928
Step 5/6 : ADD    requirements.txt    /app/
 ---> 85dea5bcbc24
Step 6/6 : RUN    pip install -r requirements.txt
 ---> Running in 7565f1395fb0
Collecting Django (from -r requirements.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/b1/1d/2476110614367adfb079a9bc718621f9fc8351e9214e1750cae1832d4090/Django-2.2.1-py3-none-any.whl (7.4MB)
Collecting psycopg2-binary (from -r requirements.txt (line 2))
  Downloading https://files.pythonhosted.org/packages/a5/bf/870a127de76b5b01c26eb8056f42a315eb9cb625b87cdee896c71bf73ca1/psycopg2_binary-2.8.2-cp37-cp37m-manylinux1_x86_64.whl (2.9MB)
Collecting sqlparse (from Django->-r requirements.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/ef/53/900f7d2a54557c6a37886585a91336520e5539e3ae2423ff1102daf4f3a7/sqlparse-0.3.0-py2.py3-none-any.whl
Collecting pytz (from Django->-r requirements.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/3d/73/fe30c2daaaa0713420d0382b16fbb761409f532c56bdcc514bf7b6262bb6/pytz-2019.1-py2.py3-none-any.whl (510kB)
Installing collected packages: sqlparse, pytz, Django, psycopg2-binary
Successfully installed Django-2.2.1 psycopg2-binary-2.8.2 pytz-2019.1 sqlparse-0.3.0
Removing intermediate container 7565f1395fb0
 ---> efd3bb3e910b
Successfully built efd3bb3e910b
Successfully tagged django-sample-for-docker-compose_django:latest
WARNING: Image for service django was built because it did not already exist. To rebuild this image you must use `docker-compose build` or `docker-compose up --build`.
Creating django-sample-for-docker-compose_db_1     ... done
Creating django-sample-for-docker-compose_django_1 ... done
Attaching to django-sample-for-docker-compose_django_1, django-sample-for-docker-compose_db_1
django_1  | bash: /wait-for-it.sh: No such file or directory
django_1  | python: can't open file 'manage.py': [Errno 2] No such file or directory
django_1  | python: can't open file 'manage.py': [Errno 2] No such file or directory
db_1      | 2019-05-30 04:41:33.882 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
db_1      | 2019-05-30 04:41:33.882 UTC [1] LOG:  listening on IPv6 address "::", port 5432
db_1      | 2019-05-30 04:41:33.889 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
db_1      | 2019-05-30 04:41:33.923 UTC [22] LOG:  database system was shut down at 2019-05-30 04:37:59 UTC
db_1      | 2019-05-30 04:41:33.933 UTC [1] LOG:  database system is ready to accept connections
django-sample-for-docker-compose_django_1 exited with code 2

빨간 줄이 이게 제일 먼저 뜨는데
debconf: delaying package configuration, since apt-utils is not installed

apt get install에 apt-utils를 추가해 봐도 같은 에러가 발생합니다.

문제가 무엇일까요?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.