Skip to content
Merged
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
19 changes: 6 additions & 13 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ jobs:
machine:
image: ubuntu-1604:202007-01

working_directory: ~/app

steps:
- checkout

Expand All @@ -22,20 +20,15 @@ jobs:
docker-compose build

- run:
name: Up Docker container
name: Up Docker containers and Confirm logs
command: |
set -x
docker-compose up -d
docker-compose run --rm app sh -c "python --version && poetry --version"

# - run:
# name: Run Docker container
# command: |
# set -x
# docker-compose up -d
# sleep 10
# docker ps -f status=running
# docker-compose logs
sleep 5
docker ps -f status=running
docker-compose logs
docker-compose run --rm app bash -c "python --version && poetry --version"
docker-compose run --rm db bash -c "psql --version"

- run:
name: Run Pytest
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,6 @@ dmypy.json

# Pyre type checker
.pyre/

# Setting by User
db/tmp
Empty file removed db/.gitkeep
Empty file.
3 changes: 1 addition & 2 deletions db/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
FROM postgres:12-alpine

EXPOSE 5432
CMD ["postgres"]
ENV LANG ja_JP.utf8
20 changes: 11 additions & 9 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
version: "3"
services:
postgres:
build: ./db
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=password
ports:
- "5432:5432"
volumes:
- ./db/data/postgres:/var/lib/postgresql/data
app:
build: ./app
user: root
Expand All @@ -24,3 +15,14 @@ services:
--allow-root
--NotebookApp.token=''
--no-browser
db:
build: ./db
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=password
- POSTGRES_DB=testdb
ports:
- "5432:5432"
volumes:
- ./db/tmp/postgres/data:/var/lib/postgresql/data
restart: always