-
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.
– use Docker for local setup – update README – update CI scripts
- Loading branch information
Showing
11 changed files
with
162 additions
and
48 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 |
---|---|---|
@@ -1 +1,4 @@ | ||
**/node_modules | ||
node_modules | ||
npm-debug.log | ||
.env* |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
FROM node:21.7.3 | ||
WORKDIR /app | ||
|
||
# Copy the rest of the application | ||
COPY . . | ||
|
||
# Install dependencies | ||
RUN chmod +x ./post-install.sh | ||
RUN npm ci | ||
|
||
ENV NODE_ENV=development | ||
|
||
# Prepare and execute entrypoint script | ||
RUN chmod +x /app/docker/dev/docker-entrypoint.sh | ||
ENTRYPOINT ["/app/docker/dev/docker-entrypoint.sh"] | ||
|
||
CMD ["/bin/sh", "-c", "npm run dev"] |
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,31 @@ | ||
services: | ||
app: | ||
build: | ||
context: ../.. | ||
dockerfile: docker/dev/Dockerfile | ||
container_name: dev-budget-tracker-app | ||
volumes: ['../../:/app', '/app/node_modules'] | ||
ports: ['${APPLICATION_PORT}:${APPLICATION_PORT}'] | ||
depends_on: ['db', 'redis'] | ||
env_file: ../../.env.development | ||
|
||
db: | ||
image: postgres:16 | ||
restart: always | ||
container_name: dev-budget-tracker-db | ||
volumes: ['db_data:/var/lib/postgresql/data'] | ||
environment: | ||
- POSTGRES_USER=${APPLICATION_DB_USERNAME} | ||
- POSTGRES_PASSWORD=${APPLICATION_DB_PASSWORD} | ||
- POSTGRES_DB=${APPLICATION_DB_DATABASE} | ||
ports: ['${APPLICATION_DB_PORT}:5432'] | ||
|
||
redis: | ||
image: redis:6 | ||
container_name: dev-budget-tracker-redis | ||
volumes: ['redis_data:/data'] | ||
ports: ['6379:6379'] | ||
|
||
volumes: | ||
db_data: | ||
redis_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/sh | ||
|
||
echo "Starting removing all dev container completely..." | ||
|
||
npm run docker:dev -- -d | ||
npm run docker:dev:down -- --rmi all --volumes --remove-orphans |
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,17 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
echo "Starting entrypoint script" | ||
|
||
# Run migrations | ||
echo "Running migrations..." | ||
if npm run migrate:dev; then | ||
echo "Migrations completed successfully" | ||
else | ||
echo "Migration failed. Exiting..." | ||
exit 1 | ||
fi | ||
|
||
# If we get here, migrations were successful | ||
echo "Starting the application..." | ||
exec "$@" |
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,6 +1,13 @@ | ||
FROM node:21.7.3 | ||
WORKDIR /app | ||
|
||
# Copy the rest of the application | ||
COPY . . | ||
RUN npm ci | ||
|
||
ENV NODE_ENV=production | ||
|
||
# Install dependencies | ||
RUN chmod +x ./post-install.sh | ||
RUN npm ci | ||
|
||
CMD ["/bin/sh", "-c", "npm run prod"] |
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,12 @@ | ||
git config blame.ignoreRevsFile .git-blame-ignore-revs | ||
#!/bin/sh | ||
set -e | ||
|
||
# Check if we're in a git repository | ||
if git rev-parse --is-inside-work-tree > /dev/null 2>&1; then | ||
echo "Running git commands..." | ||
git config blame.ignoreRevsFile .git-blame-ignore-revs | ||
else | ||
echo "Not in a git repository, skipping git commands." | ||
fi | ||
|
||
chmod +x ./docker/dev/docker-destroy.sh |
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