-
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
38e5b43
commit c810b0c
Showing
11 changed files
with
84 additions
and
10 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,3 @@ | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Build and Push Docker Image | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check out the repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Log in to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build the Docker image | ||
run: | | ||
docker build -t ghcr.io/${{ github.repository_owner }}/${{ github.repository }}:latest . | ||
- name: Push the Docker image | ||
run: | | ||
docker push ghcr.io/${{ github.repository_owner }}/${{ github.repository }}:latest |
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 |
---|---|---|
|
@@ -13,4 +13,4 @@ const assetLoader = () => { | |
module.exports = { | ||
clientLoader, | ||
assetLoader | ||
} | ||
} |
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,16 +1,20 @@ | ||
const path = require('path'); | ||
|
||
// Define dbPath from an environment variable or default to 'db.sqlite3' in the current directory | ||
const dbPath = process.env.DATABASE_PATH || path.join(__dirname, 'db.sqlite3'); | ||
|
||
/** | ||
* @type { Object.<string, import("knex").Knex.Config> } | ||
*/ | ||
module.exports = { | ||
development: { | ||
client: 'sqlite3', | ||
connection: { | ||
filename: path.join(__dirname, 'db.sqlite3') | ||
filename: dbPath, // Use the dbPath variable here | ||
}, | ||
migrations: { | ||
tableName: 'knex_migrations' | ||
tableName: 'knex_migrations', | ||
}, | ||
useNullAsDefault: true, | ||
} | ||
useNullAsDefault: true, // Required for SQLite | ||
}, | ||
}; |
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,19 @@ | ||
version: "3.8" | ||
|
||
services: | ||
app: | ||
build: | ||
context: . | ||
ports: | ||
- "3123:3123" | ||
volumes: | ||
- .:/usr/src/app | ||
- sqlite-db:/usr/src/app/database | ||
environment: | ||
- NODE_ENV=production | ||
- DATABASE_PATH=/usr/src/app/database/app.sqlite | ||
command: ["node", "index.js"] | ||
restart: unless-stopped | ||
|
||
volumes: | ||
sqlite-db: |
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,20 @@ | ||
# Use the Node.js 16 image | ||
FROM node:20-alpine | ||
|
||
# Set the working directory inside the container | ||
WORKDIR /usr/src/app | ||
|
||
# Copy the package.json and package-lock.json | ||
COPY package*.json ./ | ||
|
||
# Install dependencies | ||
RUN yarn install | ||
|
||
# Copy the entire app code into the container | ||
COPY . . | ||
|
||
# Expose the application port | ||
EXPOSE 3123 | ||
|
||
# Set the default command to start the app | ||
CMD ["node", "index.js"] |
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
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