generated from codersforcauses/django-nextjs-template
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from codersforcauses/chore/template_sync_80332e7
New devcontainer setup
- Loading branch information
Showing
7 changed files
with
91 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash | ||
|
||
# Runs once after devcontainer is created | ||
|
||
figlet "1-time Setup" | ||
echo "Running one-time setup for you :)" | ||
|
||
# Create .env files if it doesn't exist | ||
if [ ! -f ./client/.env ]; then | ||
cp ./client/.env.example ./client/.env | ||
fi | ||
if [ ! -f ./server/.env ]; then | ||
cp ./server/.env.example ./server/.env | ||
fi | ||
|
||
# Give editor intellisense | ||
(cd server && POETRY_VIRTUALENVS_CREATE=false poetry install) | ||
(cd client && npm install) | ||
|
||
# Build containers so less waiting | ||
docker compose pull | ||
docker compose build --no-cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,41 @@ | ||
services: | ||
db: | ||
container_name: db | ||
image: postgres | ||
restart: unless-stopped | ||
volumes: | ||
- ${LOCAL_WORKSPACE_FOLDER}/data/db:/var/lib/postgresql/data | ||
- ${LOCAL_WORKSPACE_FOLDER:-.}/data/db:/var/lib/postgresql/data | ||
healthcheck: | ||
test: ["CMD-SHELL", "pg_isready -U postgres"] | ||
interval: 3s | ||
timeout: 3s | ||
retries: 5 | ||
env_file: | ||
- ./server/.env | ||
env_file: ./server/.env | ||
ports: | ||
- 5432:5432 | ||
# server: | ||
# build: | ||
# context: . | ||
# dockerfile: ./docker/server/Dockerfile | ||
# restart: unless-stopped | ||
# env_file: ./server/.env | ||
# ports: | ||
# - 8000:8000 | ||
# volumes: | ||
# - ./server:/app | ||
|
||
# client: | ||
# build: | ||
# context: . | ||
# dockerfile: ./docker/client/Dockerfile | ||
# restart: unless-stopped | ||
# env_file: ./client/.env | ||
# ports: | ||
# - 3000:3000 | ||
# volumes: | ||
# - ./client:/app | ||
# - ignore:/app/node_modules | ||
server: | ||
container_name: server | ||
build: | ||
context: . | ||
dockerfile: ./docker/server/Dockerfile | ||
restart: unless-stopped | ||
env_file: ./server/.env | ||
ports: | ||
- 8000:8000 | ||
volumes: | ||
- ${LOCAL_WORKSPACE_FOLDER:-.}/server:/app | ||
client: | ||
container_name: client | ||
build: | ||
context: . | ||
dockerfile: ./docker/client/Dockerfile | ||
restart: unless-stopped | ||
env_file: ./client/.env | ||
ports: | ||
- 3000:3000 | ||
volumes: | ||
- ${LOCAL_WORKSPACE_FOLDER:-.}/client:/app | ||
- ignore:/app/node_modules | ||
|
||
# volumes: | ||
# ignore: | ||
volumes: | ||
ignore: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,10 +4,14 @@ APP_ENV=DEVELOPMENT | |
API_SECRET_KEY="supersecretkey" | ||
API_ALLOWED_HOSTS=".localhost 127.0.0.1 [::1]" | ||
|
||
POSTGRES_HOST=172.17.0.1 # use localhost if not using dev container or try host.docker.internal | ||
POSTGRES_HOST=db | ||
POSTGRES_NAME=postgres | ||
POSTGRES_USER=postgres | ||
POSTGRES_PASSWORD=password | ||
POSTGRES_PORT=5432 | ||
|
||
DJANGO_SUPERUSER_PASSWORD=Password123 | ||
DJANGO_SUPERUSER_EMAIL=[email protected] | ||
DJANGO_SUPERUSER_USERNAME=admin | ||
|
||
FRONTEND_URL="http://localhost:3000" |