Skip to content

Commit

Permalink
fixed docker
Browse files Browse the repository at this point in the history
  • Loading branch information
ClaudioMartinH committed Sep 20, 2024
1 parent 452ff19 commit e71c1ec
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion client/tsconfig.node.tsbuildinfo

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions client/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ import react from "@vitejs/plugin-react";
export default defineConfig({
plugins: [react()],
server: {
port: 5173,
proxy: {
"/api": {
target: "http://backend:3000",
changeOrigin: true,
secure: false,
},
},
},
Expand Down
13 changes: 6 additions & 7 deletions client/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
import { defineConfig } from 'vite';
// import react from '@vitejs/plugin-react';
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";

// https://vitejs.dev/config/
export default defineConfig({
// plugins: [react()],
plugins: [react()],
server: {
// port: 5173,
port: 5173,
proxy: {
'/api': {
target: 'http://localhost:3000',
"/api": {
target: "http://backend:3000",
changeOrigin: true,
secure: false,
},
},
},
});

5 changes: 4 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,12 @@ services:
ports:
- "3000:3000"
volumes:
#- ./server:/usr/src/app
- ./data:/usr/src/app/data
- /usr/src/app/node_modules
- ./db:/server/prisma/db
environment:
- DATABASE_URL=file:./dev.db
- JWT_SECRET=2c146a3da80f85866a3083e51e631c207fb45456ad86569992f1445a4043f788

volumes:
node_modules:
Expand Down
4 changes: 1 addition & 3 deletions server/.env
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
DATABASE_URL="file:./dev.db"
JWT_SECRET=2c146a3da80f85866a3083e51e631c207fb45456ad86569992f1445a4043f788
PORT=3000
# bash openssl rand -hex 32
# DATABASE_URL="mysql://root:Trilla14-16@127.0.0.1:3306/jocDeDaus"
PORT=3000
8 changes: 3 additions & 5 deletions server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ FROM node:20

WORKDIR /usr/src/app

ENV DATABASE_URL="file:./dev.db"

ENV JWT_SECRET=2c146a3da80f85866a3083e51e631c207fb45456ad86569992f1445a4043f788

COPY package*.json ./

RUN npm install
Expand All @@ -14,8 +10,10 @@ COPY . .

RUN npx prisma generate

RUN npx prisma migrate

RUN npm run build

EXPOSE 3000

CMD ["npm", "run", "start"]
CMD ["npm", "run", "dev"]

0 comments on commit e71c1ec

Please sign in to comment.