diff --git a/.gitignore b/.gitignore index 2be20d0..1dc23de 100644 --- a/.gitignore +++ b/.gitignore @@ -37,10 +37,6 @@ yarn-error.log ehthumbs.db Thumbs.db -# Docker -Dockerfile -docker-compose.yml - # Env files .env .env.local diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..a374e0d --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,14 @@ +version: '3' +services: + frontend: + build: + context: ./interactive-pathways + dockerfile: Dockerfile + ports: + - "88:80" + backend: + build: + context: ./interactive-pathways-api + dockerfile: Dockerfile + ports: + - "8888:8080" \ No newline at end of file diff --git a/interactive-pathways/Dockerfile b/interactive-pathways/Dockerfile new file mode 100644 index 0000000..27d80fd --- /dev/null +++ b/interactive-pathways/Dockerfile @@ -0,0 +1,21 @@ +# Build stage +FROM node:14 as build +WORKDIR /app + +# Copy package.json and package-lock.json (if available) +COPY site/package*.json ./ + +# Install dependencies +RUN npm install + +# Copy the rest of the application +COPY site ./ + +# Build the app +RUN npm run build + +# Production stage +FROM nginx:alpine +COPY --from=build /app/build /usr/share/nginx/html +EXPOSE 80 +CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file