-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a6dba43
commit 92934a3
Showing
9 changed files
with
121 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
services: | ||
frontend: | ||
container_name: frontend | ||
build: | ||
context: ./frontend | ||
image: pdelebarre/guitar-tutorial-app-frontend | ||
ports: | ||
- "3000:80" | ||
environment: | ||
# Set VITE_API_URL to the internal backend service name inside Docker | ||
- VITE_API_URL=http://backend:8080 | ||
depends_on: | ||
- backend | ||
networks: | ||
- guitartuto-network | ||
|
||
backend: | ||
container_name: backend | ||
build: | ||
context: ./backend | ||
dockerfile: Dockerfile | ||
image: pdelebarre/guitar-tutorial-app-backend | ||
ports: | ||
- "8080:8080" | ||
environment: | ||
TUTORIALS_PATH: /app/tutorials | ||
SPRING_PROFILES_ACTIVE: prod | ||
SPRING_DATASOURCE_URL: jdbc:postgresql://postgres:5432/guitardb | ||
SPRING_DATASOURCE_USERNAME: myuser | ||
SPRING_DATASOURCE_PASSWORD: mypassword | ||
volumes: | ||
- /volume1/docker/guitar-tutorial/tutorials:/app/tutorials | ||
networks: | ||
- guitartuto-network | ||
depends_on: | ||
- postgres | ||
|
||
postgres: | ||
image: postgres:17-alpine | ||
container_name: postgres | ||
environment: | ||
POSTGRES_USER: myuser | ||
POSTGRES_PASSWORD: mypassword | ||
POSTGRES_DB: guitardb | ||
ports: | ||
- "5433:5432" | ||
volumes: | ||
- postgres_data:/var/lib/postgresql/data | ||
networks: | ||
- guitartuto-network | ||
healthcheck: | ||
test: ["CMD-SHELL", "pg_isready -U myuser -d guitardb"] | ||
interval: 10s | ||
retries: 5 | ||
start_period: 5s | ||
|
||
networks: | ||
guitartuto-network: | ||
driver: bridge | ||
|
||
volumes: | ||
postgres_data: |
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 +1,21 @@ | ||
node_modules/ | ||
# Versioning and metadata | ||
.git | ||
.gitignore | ||
.dockerignore | ||
|
||
# Build dependencies | ||
dist | ||
build | ||
node_modules | ||
coverage | ||
|
||
# Environment (contains sensitive data) | ||
.env | ||
.env.development | ||
|
||
# Files not required for production | ||
.editorconfig | ||
Dockerfile | ||
README.md | ||
tslint.json | ||
nodemon.json |
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 +1,3 @@ | ||
VITE_API_URL=http://localhost:8080/api | ||
VITE_API_BASE_URL=http://localhost | ||
VITE_API_PORT=8080 | ||
VITE_ENVIRONMENT=DEVELOPMENT |
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,3 @@ | ||
VITE_API_BASE_URL=GUITARTUTORIALAPP_API_BASE_URL | ||
VITE_API_PORT=GUITARTUTORIALAPP_API_PORT | ||
VITE_ENVIRONMENT=PRODUCTION |
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,12 @@ | ||
#!/bin/sh | ||
for i in $(env | grep GUITARTUTORIALAPP_) | ||
do | ||
key=$(echo $i | cut -d '=' -f 1) | ||
value=$(echo $i | cut -d '=' -f 2-) | ||
echo $key=$value | ||
# sed All files | ||
# find /usr/share/nginx/html -type f -exec sed -i "s|${key}|${value}|g" '{}' + | ||
|
||
# sed JS and CSS only | ||
find /usr/share/nginx/html -type f \( -name '*.js' -o -name '*.css' \) -exec sed -i "s|${key}|${value}|g" '{}' + | ||
done |
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 +1,8 @@ | ||
/// <reference types="vite/client" /> | ||
declare namespace NodeJS { | ||
interface ProcessEnv { | ||
VITE_API_BASE_URL: string; | ||
VITE_API_PORT: string; | ||
// Add other environment variables here if needed | ||
} | ||
} |