new build structure
This commit is contained in:
@@ -1,10 +0,0 @@
|
|||||||
services:
|
|
||||||
api:
|
|
||||||
build: .
|
|
||||||
container_name: email-config-api
|
|
||||||
restart: always
|
|
||||||
env_file:
|
|
||||||
- .env
|
|
||||||
ports:
|
|
||||||
# Verwendet PORT aus deiner .env für Host und Container
|
|
||||||
- "${PORT}:${PORT}"
|
|
||||||
24
docker-compose.yml
Normal file
24
docker-compose.yml
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
# /home/aknuth/git/config-email/docker-compose.yml
|
||||||
|
|
||||||
|
services:
|
||||||
|
config-email-frontend:
|
||||||
|
build: ./frontend
|
||||||
|
container_name: config-email-frontend
|
||||||
|
restart: unless-stopped
|
||||||
|
networks:
|
||||||
|
- bizmatch
|
||||||
|
|
||||||
|
config-email-backend:
|
||||||
|
build: ./backend
|
||||||
|
container_name: config-email-backend
|
||||||
|
restart: unless-stopped
|
||||||
|
env_file:
|
||||||
|
- ./backend/.env # Hier müssen deine AWS Keys und das TOKEN_SECRET rein!
|
||||||
|
environment:
|
||||||
|
- PORT=3001
|
||||||
|
networks:
|
||||||
|
- bizmatch
|
||||||
|
|
||||||
|
networks:
|
||||||
|
bizmatch:
|
||||||
|
external: true
|
||||||
24
frontend/Dockerfile
Normal file
24
frontend/Dockerfile
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
# frontend/Dockerfile
|
||||||
|
FROM node:20-alpine AS build
|
||||||
|
WORKDIR /app
|
||||||
|
COPY package*.json ./
|
||||||
|
RUN npm install
|
||||||
|
COPY . .
|
||||||
|
# Wir setzen die API-URL auf den relativen Pfad, da Frontend und Backend
|
||||||
|
# jetzt unter der gleichen Domain laufen werden!
|
||||||
|
ENV VITE_API_URL=""
|
||||||
|
RUN npm run build
|
||||||
|
|
||||||
|
FROM nginx:alpine
|
||||||
|
COPY --from=build /app/dist /usr/share/nginx/html
|
||||||
|
# Standard Nginx-Config für Single Page Applications (React/Vite)
|
||||||
|
RUN echo 'server { \
|
||||||
|
listen 80; \
|
||||||
|
location / { \
|
||||||
|
root /usr/share/nginx/html; \
|
||||||
|
index index.html; \
|
||||||
|
try_files $uri $uri/ /index.html; \
|
||||||
|
} \
|
||||||
|
}' > /etc/nginx/conf.d/default.conf
|
||||||
|
EXPOSE 80
|
||||||
|
CMD ["nginx", "-g", "daemon off;"]
|
||||||
Reference in New Issue
Block a user