Skip to content

Commit 6924534

Browse files
committed
Added Dockerfile for matching service.
1 parent 4fc2f91 commit 6924534

File tree

3 files changed

+94
-0
lines changed

3 files changed

+94
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Include any files or directories that you don't want to be copied to your
2+
# container here (e.g., local build artifacts, temporary files, etc.).
3+
#
4+
# For more help, visit the .dockerignore file reference guide at
5+
# https://docs.docker.com/go/build-context-dockerignore/
6+
7+
**/.classpath
8+
**/.dockerignore
9+
**/.env
10+
**/.git
11+
**/.gitignore
12+
**/.project
13+
**/.settings
14+
**/.toolstarget
15+
**/.vs
16+
**/.vscode
17+
**/.next
18+
**/.cache
19+
**/*.*proj.user
20+
**/*.dbmdl
21+
**/*.jfm
22+
**/charts
23+
**/docker-compose*
24+
**/compose.y*ml
25+
**/Dockerfile*
26+
**/node_modules
27+
**/npm-debug.log
28+
**/obj
29+
**/secrets.dev.yaml
30+
**/values.dev.yaml
31+
**/build
32+
**/dist
33+
LICENSE
34+
README.md
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# syntax=docker/dockerfile:1
2+
3+
# Comments are provided throughout this file to help you get started.
4+
# If you need more help, visit the Dockerfile reference guide at
5+
# https://docs.docker.com/go/dockerfile-reference/
6+
7+
# Want to help us make this template better? Share your feedback here: https://forms.gle/ybq9Krt8jtBL3iCk7
8+
9+
ARG NODE_VERSION=22.21.0
10+
11+
FROM node:${NODE_VERSION}-alpine
12+
13+
# Use production node environment by default.
14+
ENV NODE_ENV production
15+
16+
17+
WORKDIR /usr/src/app
18+
19+
# Download dependencies as a separate step to take advantage of Docker's caching.
20+
# Leverage a cache mount to /root/.npm to speed up subsequent builds.
21+
# Leverage a bind mounts to package.json and package-lock.json to avoid having to copy them into
22+
# into this layer.
23+
RUN --mount=type=bind,source=package.json,target=package.json \
24+
--mount=type=bind,source=package-lock.json,target=package-lock.json \
25+
--mount=type=cache,target=/root/.npm \
26+
npm ci --omit=dev
27+
28+
# Run the application as a non-root user.
29+
USER node
30+
31+
# Copy the rest of the source files into the image.
32+
COPY . .
33+
34+
# Expose the port that the application listens on.
35+
EXPOSE 4001
36+
37+
# Run the application.
38+
CMD npm start
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
### Building and running your application
2+
3+
When you're ready, start your application by running:
4+
`docker compose up --build`.
5+
6+
Your application will be available at http://localhost:4001.
7+
8+
### Deploying your application to the cloud
9+
10+
First, build your image, e.g.: `docker build -t myapp .`.
11+
If your cloud uses a different CPU architecture than your development
12+
machine (e.g., you are on a Mac M1 and your cloud provider is amd64),
13+
you'll want to build the image for that platform, e.g.:
14+
`docker build --platform=linux/amd64 -t myapp .`.
15+
16+
Then, push it to your registry, e.g. `docker push myregistry.com/myapp`.
17+
18+
Consult Docker's [getting started](https://docs.docker.com/go/get-started-sharing/)
19+
docs for more detail on building and pushing.
20+
21+
### References
22+
* [Docker's Node.js guide](https://docs.docker.com/language/nodejs/)

0 commit comments

Comments
 (0)