diff options
Diffstat (limited to 'Containerfile')
| -rw-r--r-- | Containerfile | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/Containerfile b/Containerfile new file mode 100644 index 0000000..45b52a9 --- /dev/null +++ b/Containerfile | |||
| @@ -0,0 +1,34 @@ | |||
| 1 | FROM fedora:42 | ||
| 2 | |||
| 3 | # Install Node.js and npm | ||
| 4 | RUN dnf install -y nodejs npm && \ | ||
| 5 | dnf clean all | ||
| 6 | |||
| 7 | # Create app directory | ||
| 8 | WORKDIR /app | ||
| 9 | |||
| 10 | # Copy package files and install production dependencies only | ||
| 11 | COPY frontend/package*.json ./ | ||
| 12 | RUN npm ci --only=production && \ | ||
| 13 | npm cache clean --force | ||
| 14 | |||
| 15 | # Copy the pre-built Next.js application | ||
| 16 | COPY frontend/.next ./.next | ||
| 17 | COPY frontend/public ./public | ||
| 18 | COPY frontend/next.config.ts ./ | ||
| 19 | COPY frontend/package.json ./ | ||
| 20 | |||
| 21 | |||
| 22 | # Copy the built fctdrive binary to PATH | ||
| 23 | COPY target/release/fctdrive /usr/local/bin/fctdrive | ||
| 24 | RUN chmod +x /usr/local/bin/fctdrive | ||
| 25 | |||
| 26 | # Expose port | ||
| 27 | EXPOSE 3000 | ||
| 28 | |||
| 29 | # Set environment variables | ||
| 30 | ENV NODE_ENV=production | ||
| 31 | ENV HOSTNAME=0.0.0.0 | ||
| 32 | |||
| 33 | # Start the Next.js server | ||
| 34 | CMD ["npm", "start"] | ||
