refactor: change ports to non-standard (backend: 8765, frontend: 4321)
This commit is contained in:
+2
-2
@@ -7,6 +7,6 @@ RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
COPY . .
|
||||
|
||||
EXPOSE 8000
|
||||
EXPOSE 8765
|
||||
|
||||
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
|
||||
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8765"]
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ app = FastAPI(title="Kopilka API", version="1.0.0")
|
||||
|
||||
app.add_middleware(
|
||||
CORSMiddleware,
|
||||
allow_origins=["http://localhost:5173", "http://localhost:3000"],
|
||||
allow_origins=["http://localhost:5173", "http://localhost:4321"],
|
||||
allow_credentials=True,
|
||||
allow_methods=["*"],
|
||||
allow_headers=["*"],
|
||||
|
||||
+2
-2
@@ -4,7 +4,7 @@ services:
|
||||
context: ./backend
|
||||
dockerfile: Dockerfile
|
||||
ports:
|
||||
- "8000:8000"
|
||||
- "8765:8765"
|
||||
environment:
|
||||
- PYTHONUNBUFFERED=1
|
||||
volumes:
|
||||
@@ -16,7 +16,7 @@ services:
|
||||
context: ./frontend
|
||||
dockerfile: Dockerfile
|
||||
ports:
|
||||
- "3000:3000"
|
||||
- "4321:4321"
|
||||
depends_on:
|
||||
- backend
|
||||
restart: unless-stopped
|
||||
|
||||
+1
-1
@@ -9,5 +9,5 @@ RUN npm run build
|
||||
FROM nginx:alpine
|
||||
COPY --from=builder /app/dist /usr/share/nginx/html
|
||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||
EXPOSE 3000
|
||||
EXPOSE 4321
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
server {
|
||||
listen 3000;
|
||||
listen 4321;
|
||||
server_name _;
|
||||
|
||||
resolver 127.0.0.11 valid=10s;
|
||||
set $backend_url http://backend:8000;
|
||||
set $backend_url http://backend:8765;
|
||||
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
|
||||
@@ -5,9 +5,9 @@ export default defineConfig({
|
||||
plugins: [react()],
|
||||
server: {
|
||||
host: true,
|
||||
port: 3000,
|
||||
port: 4321,
|
||||
proxy: {
|
||||
'/api': 'http://backend:8000',
|
||||
'/api': 'http://backend:8765',
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user