Skip to content

Commit

Permalink
API App and UI App + Docker tools
Browse files Browse the repository at this point in the history
  • Loading branch information
redji committed Apr 12, 2024
1 parent 1faa688 commit d729638
Show file tree
Hide file tree
Showing 44 changed files with 11,235 additions and 0 deletions.
32 changes: 32 additions & 0 deletions API/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
module.exports = {
env: {
browser: true,
es2021: true
},
extends: [
'standard',
'plugin:vue/vue3-essential'
],
overrides: [
{
env: {
node: true
},
files: [
'.eslintrc.{js,cjs}'
],
parserOptions: {
sourceType: 'script'
}
}
],
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module'
},
plugins: [
'vue'
],
rules: {
}
}
20 changes: 20 additions & 0 deletions API/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Use Alpine Linux as base image
FROM node:alpine

# Set the working directory in the container
WORKDIR /usr/src/app

# Copy package.json and package-lock.json to the working directory
COPY package*.json ./

# Install dependencies
RUN npm install

# Copy the rest of the application code to the working directory
COPY . .

# Expose port 3000
EXPOSE 3000

# Command to run the application
CMD ["node", "app.js"]
12 changes: 12 additions & 0 deletions API/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// index.js
const express = require('express');
const app = express();
const PORT = process.env.PORT || 3000;

app.get('/', (req, res) => {
res.send('Hello, Aiva!');
});

app.listen(PORT, () => {
console.log(`Server is running on port ${PORT}`);
});
3 changes: 3 additions & 0 deletions API/build_docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
docker build -t aiva .
docker tag aiva aiblast/aiva:latest
docker push aiblast/aiva:latest
2 changes: 2 additions & 0 deletions API/clean_docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
docker rm -v -f $(docker ps -qa)
docker system prune -a
Loading

0 comments on commit d729638

Please sign in to comment.