diff --git a/backend/docker-compose.yml b/backend/docker-compose.yml deleted file mode 100644 index 81695a1..0000000 --- a/backend/docker-compose.yml +++ /dev/null @@ -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}" \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..b75d534 --- /dev/null +++ b/docker-compose.yml @@ -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 \ No newline at end of file diff --git a/frontend/Dockerfile b/frontend/Dockerfile new file mode 100644 index 0000000..d73a519 --- /dev/null +++ b/frontend/Dockerfile @@ -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;"] \ No newline at end of file