Skip to content

Commit

Permalink
feat: dockerizing api (#4109)
Browse files Browse the repository at this point in the history
* feat: dockerizing api

* fix: updates per eric
  • Loading branch information
YazeedLoonat committed Jun 5, 2024
1 parent 2c3f4cb commit c19f18c
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 1 deletion.
5 changes: 5 additions & 0 deletions api/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Dockerfile
.dockerignore
node_modules
dist
coverage
31 changes: 31 additions & 0 deletions api/Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
12 changes: 12 additions & 0 deletions api/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -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'
2 changes: 1 addition & 1 deletion sites/public/.env.template
Original file line number Diff line number Diff line change
@@ -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=
Expand Down

0 comments on commit c19f18c

Please sign in to comment.