generated from GDGVIT/template
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add Docker support with Dockerfile and compose.yaml
- Loading branch information
Showing
6 changed files
with
682 additions
and
356 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
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,3 @@ | ||
node_modules | ||
npm-debug.log | ||
.env |
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,36 @@ | ||
# Use platform-specific base image | ||
FROM --platform=linux/arm64 node:18 | ||
|
||
# Set working directory | ||
WORKDIR /usr/src/app | ||
|
||
# Copy package files | ||
COPY package*.json ./ | ||
|
||
# Install Sharp specifically for ARM64 | ||
RUN npm install --platform=linux --arch=arm64 sharp | ||
RUN npm install | ||
RUN npm ci && \ | ||
npm rebuild @tensorflow/tfjs-node --build-from-source | ||
|
||
# System dependencies | ||
RUN apt-get update && \ | ||
apt-get install -y curl tar && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Download model | ||
RUN mkdir -p /app/arbitrary-image-stylization-v1-tensorflow1-256-v2 && \ | ||
curl -L -o /app/arbitrary-image-stylization-v1-tensorflow1-256-v2.tar.gz \ | ||
https://www.kaggle.com/api/v1/models/google/arbitrary-image-stylization-v1/tensorFlow1/256/2/download && \ | ||
tar -xvzf /app/arbitrary-image-stylization-v1-tensorflow1-256-v2.tar.gz -C /app/arbitrary-image-stylization-v1-tensorflow1-256-v2 && \ | ||
rm /app/arbitrary-image-stylization-v1-tensorflow1-256-v2.tar.gz | ||
|
||
# Copy the rest of the application files into the container | ||
COPY . . | ||
|
||
# Expose the port the app runs on | ||
EXPOSE 3000 | ||
|
||
# Specify the command to run your application | ||
CMD ["node", "app.js"] |
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,12 @@ | ||
version: '3.8' | ||
services: | ||
app: | ||
build: | ||
context: . | ||
volumes: | ||
- ./public/uploads:/app/public/uploads | ||
- ./public/placeholders:/app/public/placeholders | ||
ports: | ||
- "8000:8000" | ||
env_file: | ||
- .env |
Oops, something went wrong.