-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6a3b4e0
commit c2f24f4
Showing
2 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Use the official Node.js 18.16.0 image from Docker Hub | ||
# Note 3d-web-experience is picky here and only allows exactly 18.16.0 | ||
# Not even 18.16.1 is supported... | ||
FROM node:18.16.0 | ||
|
||
# Create and set the working directory inside the container | ||
WORKDIR /app | ||
|
||
# Copy project contents | ||
COPY . . | ||
|
||
# Remove unneeded folders - this could be done better by not copying them in the first place | ||
RUN rm -rf node_modules .nx .github .codesandbox | ||
|
||
# Install the project dependencies | ||
RUN npm install | ||
RUN npm run build | ||
|
||
# Expose the port your app runs on | ||
EXPOSE 8080 | ||
|
||
# Command to run your app | ||
CMD ["npm", "run", "start"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
version: '3.8' | ||
services: | ||
app: | ||
build: . | ||
ports: | ||
- "8080:8080" | ||
volumes: | ||
# Mount the local folder to reflect code-changes in the container | ||
- .:/app | ||
# Ensure node_modules is not mounted | ||
- /app/node_modules | ||
# Use the cache-volume | ||
- nx-cache:/app/.nx | ||
environment: | ||
NODE_ENV: development | ||
command: npm run start | ||
|
||
volumes: | ||
nx-cache: |