Skip to content

Commit

Permalink
Update Dockerfile, package.json, app.js, compose.yml, frontend styles…
Browse files Browse the repository at this point in the history
…, routes, and Pinia dependency
  • Loading branch information
mauriciobellon committed Apr 21, 2024
1 parent 95e3af4 commit c1d18ad
Show file tree
Hide file tree
Showing 38 changed files with 45 additions and 24 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
node_modules/
tokens/
package-lock.json
dist/
package-lock.json
9 changes: 0 additions & 9 deletions app/Dockerfile

This file was deleted.

5 changes: 5 additions & 0 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM node
WORKDIR /app
COPY . .
RUN npm install --silent
CMD npm start
10 changes: 7 additions & 3 deletions app/app.js → backend/app.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
const express = require("express");
const app = express();
const port = 5000;
app.use(express.static("client/dist"));
const port = 5001;

app.get("/", (req, res) => {
res.send("Backend Working");
});

app.listen(port, () => {
console.log(`Backend Working at http://localhost:${port}`);
});
});
2 changes: 1 addition & 1 deletion app/package.json → backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
"@wppconnect-team/wppconnect": "^1.30.1",
"express": "^4.19.2"
}
}
}
File renamed without changes.
40 changes: 31 additions & 9 deletions compose.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,45 @@
version: '3.9'
networks:
webapp:
driver: bridge
database:
driver: bridge
services:
## APP ##
app:
container_name: app
## FRONTEND ##
frontend:
container_name: frontend
build:
context: ./app
context: ./frontend
networks:
- webapp
ports:
- 5000:5000
depends_on:
- postgres
- backend
restart: always
## BACKEND ##
backend:
container_name: backend
build:
context: ./backend
networks:
- webapp
- database
ports:
- 5001:5001
depends_on:
- postgres_db
restart: always
## POSTGRES ##
postgres:
container_name: postgres
postgres_db:
container_name: postgres_db
image: postgres
environment:
- POSTGRES_USER=postgres_user
- POSTGRES_PASSWORD=postgres_password
- POSTGRES_DB=postgres
- POSTGRES_DB=postgres_db
volumes:
- ./app/database:/docker-entrypoint-initdb.d
- ./database:/docker-entrypoint-initdb.d
networks:
- database
restart: always
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit c1d18ad

Please sign in to comment.