Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add postgresql and pgloader for transition to Postgresql #1283

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ WORKDIR /app
ENV DJANGO_SETTINGS_MODULE=basket.settings

COPY docker/bin/apt-install /usr/local/bin/
RUN apt-install default-libmysqlclient-dev libxslt1.1 libxml2
RUN apt-install default-libmysqlclient-dev libxslt1.1 libxml2 postgresql-client

ARG GIT_SHA=latest
ENV GIT_SHA=${GIT_SHA}
Expand Down
24 changes: 24 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,26 @@ services:
- MYSQL_ALLOW_EMPTY_PASSWORD=yes
- MYSQL_DATABASE=basket

postgres:
image: postgres:15-alpine
environment:
POSTGRES_DB: basket
POSTGRES_USER: basket
POSTGRES_PASSWORD: basket
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
interval: 2s
timeout: 2s
retries: 10

pgloader:
image: dimitri/pgloader:latest
depends_on:
- db
- postgres
command:
pgloader --verbose mysql://root@db/basket postgresql://basket:basket@postgres/basket

redis:
image: redis
platform: linux/amd64
Expand All @@ -26,6 +46,7 @@ services:
- "8000:8000"
depends_on:
- db
- postgres
- redis
command:
./bin/run-dev.sh
Expand All @@ -41,6 +62,7 @@ services:
- .env
depends_on:
- db
- postgres
- redis
command:
./bin/run-worker.sh
Expand All @@ -55,6 +77,7 @@ services:
- docker/envfiles/test.env
depends_on:
- db
- postgres
- redis
command:
./bin/run-tests.sh
Expand All @@ -67,6 +90,7 @@ services:
- docker/envfiles/test.env
depends_on:
- db
- postgres
- redis
command:
./bin/run-tests.sh
Expand Down
3 changes: 2 additions & 1 deletion docker/envfiles/local.env
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
ALLOWED_HOSTS=localhost,127.0.0.1,testserver
DATABASE_URL=mysql://root@db/basket
#DATABASE_URL=mysql://root@db/basket
DATABASE_URL=postgres://basket:basket@postgres/basket
DEBUG=True
DJANGO_LOG_LEVEL=DEBUG
LOCAL_DEV=True
Expand Down
Loading
Loading