diff --git a/api/.dockerignore b/api/.dockerignore new file mode 100644 index 0000000000..ba084ea43b --- /dev/null +++ b/api/.dockerignore @@ -0,0 +1,5 @@ +Dockerfile +.dockerignore +node_modules +dist +coverage diff --git a/api/Dockerfile b/api/Dockerfile new file mode 100644 index 0000000000..50b3189454 --- /dev/null +++ b/api/Dockerfile @@ -0,0 +1,31 @@ + +# Base image +FROM node:18 + +# Create working directory +WORKDIR /usr/src/api + +# Copy package.json +COPY package.json ./ + +# Copy yarn.lcok +COPY yarn.lock ./ + +# run yarn install +RUN yarn install + +# Copy source code into docker image +COPY . . + +# Copy .env +COPY .env ./ + +# run build commands +RUN yarn prisma generate +RUN yarn build + +# Expose port 3100 for api +EXPOSE 3100 + +# Start api +CMD ["yarn", "dev"] diff --git a/api/docker-compose.yml b/api/docker-compose.yml new file mode 100644 index 0000000000..6beab39e1e --- /dev/null +++ b/api/docker-compose.yml @@ -0,0 +1,12 @@ +services: + api: + build: + context: . + dockerfile: Dockerfile + container_name: api + environment: + - PORT=${PORT} + ports: + - '3100:3100' + extra_hosts: + - 'host.docker.internal:host-gateway' diff --git a/sites/public/.env.template b/sites/public/.env.template index 18ac68344a..9698fc9468 100644 --- a/sites/public/.env.template +++ b/sites/public/.env.template @@ -1,6 +1,6 @@ ## == IMPORTANT REMINDER: ANY EDITS HERE MUST BE UPDATED IN ALL ENVIRONMENTS (incl. CI) == ## BACKEND_API_BASE=http://localhost:3100 -BACKEND_API_BASE_NEW=http://localhost:3101 +BACKEND_API_BASE_NEW=http://localhost:3100 BACKEND_PROXY_BASE= LISTINGS_QUERY=/listings HOUSING_COUNSELOR_SERVICE_URL=