|
1 |
| -# Stage 1: Build the Electron app with Node.js on an ARM64 architecture |
2 |
| -FROM arm64v8/node:lts as builder |
| 1 | +FROM arm64v8/ubuntu:latest |
| 2 | + |
| 3 | +# Setup environment and install necessary packages |
| 4 | +RUN apt-get update && apt-get install -y \ |
| 5 | + curl \ |
| 6 | + software-properties-common \ |
| 7 | + gnupg |
| 8 | + |
| 9 | +# Add the NodeSource repository for the latest Node.js LTS version |
| 10 | +RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - |
| 11 | + |
| 12 | +# Install Node.js LTS and Snapcraft |
| 13 | +RUN apt-get update && apt-get install -y \ |
| 14 | + nodejs \ |
| 15 | + snapcraft |
3 | 16 |
|
4 | 17 | # Set the working directory
|
5 | 18 | WORKDIR /app
|
6 | 19 |
|
7 |
| -COPY package*.json ./ |
8 |
| -RUN npm install |
| 20 | +# Copy your project files into the Docker image |
| 21 | +COPY . /app |
9 | 22 |
|
10 |
| -COPY . . |
| 23 | +# Install project dependencies |
| 24 | +RUN yarn install |
11 | 25 |
|
12 |
| -# Here, ensure all environment variables needed are set |
| 26 | +# Build your Electron app (assuming npm script is correctly set) |
13 | 27 | ENV NODE_ENV=production
|
14 | 28 |
|
15 | 29 | RUN node ./scripts/fix-packages-publish.js before
|
16 | 30 | RUN npm run publish-electron-arm64 --verbose
|
17 | 31 | RUN node ./scripts/fix-packages-publish.js after
|
18 | 32 |
|
19 |
| -# Stage 2: Use an ARM64 Ubuntu image to install and use Snapcraft |
20 |
| -FROM arm64v8/ubuntu:latest |
21 |
| - |
22 |
| -RUN apt-get update && \ |
23 |
| - apt-get install -y software-properties-common && \ |
24 |
| - add-apt-repository universe && \ |
25 |
| - apt-get update && \ |
26 |
| - apt-get install -y snapcraft |
27 |
| - |
28 |
| -# Continue with your setup |
29 |
| - |
30 |
| -# Copy the built app from the first stage |
31 |
| -COPY --from=builder /app /app |
32 |
| - |
33 |
| -# Set the working directory |
34 |
| -WORKDIR /app |
35 |
| - |
36 |
| -# Build the snap (assuming snapcraft.yaml is configured) |
37 |
| -# Uncomment the next line if you need to build the snap as part of the Docker build |
38 |
| -# RUN snapcraft |
| 33 | +# Optional: specify where the snap file should be stored (if you want to copy it out) |
| 34 | +# VOLUME [ "/output" ] |
| 35 | +# RUN cp *.snap /output/ |
0 commit comments