Skip to content

Commit

Permalink
fix(docker): Docker Compose reorganized
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmeak authored and Almad committed Feb 26, 2024
1 parent a57f3e7 commit c71afcd
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 52 deletions.
1 change: 1 addition & 0 deletions .docker/database/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FROM mariadb:latest
13 changes: 13 additions & 0 deletions .docker/web/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM python:3.8

ENV PYTHONUNBUFFERED 1

RUN mkdir /code
WORKDIR /code

RUN pip install --upgrade pip

ADD requirements.txt .
RUN apt update \
&& apt install -y memcached libmemcached-dev \
&& pip install -r requirements.txt
15 changes: 15 additions & 0 deletions .docker/web/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Django>=2.0.0,<2.1
mysqlclient>=1.3.7,<1.4
gunicorn
sqlparse
argon2-cffi
bcrypt
pytz
pyyaml
sentry-sdk>=0.14.1
selenium
whitenoise
django-storages<1.10
boto3
django-bmemcached
python-binary-memcached
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
__pycache__
/.cache
/.db
.db-data

/docs/_build/

Expand All @@ -16,8 +17,8 @@ __pycache__
.DS_store

# Local building tools
/docker-compose.yml
docker-compose.yml

## Local IDEs dirs
.idea
/.idea
/.vscode
7 changes: 0 additions & 7 deletions Dockerfile

This file was deleted.

41 changes: 24 additions & 17 deletions docker-compose.example.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,33 @@
version: '3'
version: '3.9'

services:

services:
db:
image: mysql:5.5
volumes:
- .db:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=docker
- MYSQL_DATABASE=dracidoupe_cz
web:
build: .
command: python3 manage.py runserver 0.0.0.0:8000
build:
context: .docker/web
dockerfile: Dockerfile
depends_on:
- db
volumes:
- .:/code
ports:
- "8000:8000"
- "32768-65535"
depends_on:
- db
command: /bin/bash -c "python3 manage.py runserver 0.0.0.0:8000"

db:
build:
context: .docker/database
dockerfile: Dockerfile
volumes:
- .docker/database/.db-data:/var/lib/mysql
environment:
- MARIADB_ROOT_PASSWORD=docker
- MARIADB_DATABASE=dracidoupe_cz

adminer:
image: adminer
links:
- db
ports:
- 81:80
- "8080:8080"
depends_on:
- db

7 changes: 6 additions & 1 deletion docker-compose.server_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ version: '3'
# See https://circleci.com/docs/2.0/executor-types/

services:

db:
image: mysql:5.5
environment:
Expand All @@ -13,8 +14,12 @@ services:
web:
environment:
- SERVER_CI=true
build: .
build:
context: .docker/web
dockerfile: Dockerfile
command: python3 manage.py runserver 0.0.0.0:8000
volumes:
- .:/code
expose:
- "8000"
- "32768-65535"
Expand Down
25 changes: 0 additions & 25 deletions docker-compose.yml

This file was deleted.

0 comments on commit c71afcd

Please sign in to comment.