Skip to content

Commit

Permalink
chore: setup config for external volumes (Postgres)
Browse files Browse the repository at this point in the history
  • Loading branch information
raphael0202 committed Feb 16, 2024
1 parent 89d465d commit 64ca6f8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ down:
${DOCKER_COMPOSE} down


# Create all external volumes needed for production. Using external volumes is useful to prevent data loss (as they are not deleted when performing docker down -v)
create_external_volumes:
@echo "🥫 Creating external volumes (production only) …"
docker volume create nutripatrol-postgres-data

#-----------#
# Utilities #
#-----------#
Expand Down
3 changes: 2 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,5 @@ services:
- "${POSTGRES_EXPOSE:-127.0.0.1:5432}:5432"

volumes:
postgres-data:
postgres-data:
name: ${COMPOSE_PROJECT_NAME:-nutripatrol}-postgres-data
6 changes: 4 additions & 2 deletions docker/prod.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
version: "3.7"
version: "3.9"

# modifications to docker-compose for production settings
volumes:
postgres-data:
external: true

0 comments on commit 64ca6f8

Please sign in to comment.