diff --git a/api/Dockerfile b/api/Dockerfile new file mode 100644 index 00000000..568c7897 --- /dev/null +++ b/api/Dockerfile @@ -0,0 +1,16 @@ +FROM python:3.9 + +WORKDIR /code + +COPY ./requirements.txt /code/requirements.txt + +RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt +RUN pip install fastapi uvicorn + +COPY . /code + +# CMD ["fastapi", "run", "main.py", "--port", "80"] +CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "80"] + +# If running behind a proxy like Nginx or Traefik add --proxy-headers +# CMD ["fastapi", "run", "app/main.py", "--port", "80", "--proxy-headers"] \ No newline at end of file diff --git a/front-end-nextjs/Dockerfile b/front-end-nextjs/Dockerfile new file mode 100644 index 00000000..5e5e3b8f --- /dev/null +++ b/front-end-nextjs/Dockerfile @@ -0,0 +1,21 @@ +FROM node:18-alpine AS builder + +WORKDIR /app + +COPY package*.json ./ + +RUN npm install + +COPY . . + +RUN npm run build + + +FROM node:18-alpine AS runner +WORKDIR /app + +COPY --from=builder /app/.next/standalone ./standalone + +EXPOSE 3000 + +CMD ["node", "./standalone/server.js"] \ No newline at end of file diff --git a/front-end-nextjs/next.config.js b/front-end-nextjs/next.config.js index 767719fc..445e35fd 100644 --- a/front-end-nextjs/next.config.js +++ b/front-end-nextjs/next.config.js @@ -1,4 +1,6 @@ /** @type {import('next').NextConfig} */ -const nextConfig = {} +const nextConfig = { + output: 'standalone' +} module.exports = nextConfig