diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..be1af78d --- /dev/null +++ b/.dockerignore @@ -0,0 +1,24 @@ +# Ignore Node.js modules +node_modules/ + +# Ignore compiled output +dist/ + +# Ignore logs +*.log + +# Ignore system files +.DS_Store +Thumbs.db + +# Ignore environment-specific files +.env +.env.* + +# Ignore code editors and IDEs +.idea/ +.vscode/ + +# Ignore Git files +.git/ +.gitignore diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..2436a87b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,28 @@ +# Stage 1: Build the Angular app +FROM node:latest AS builder + +WORKDIR /usr/src/app + +# Copy package.json and package-lock.json to the container +COPY package*.json ./ + +RUN npm install -g @angular/cli + +# Copy the rest of the application code to the container +COPY . . + +# Install dependencies and build the app +RUN npm install +RUN npm run build-prod-memory + +# Stage 2: Create the final image +FROM nginx:alpine + +# Copy the built Angular app from the previous stage +COPY --from=builder /usr/src/app/dist /usr/share/nginx/html + +# Expose port 80 (the default Nginx port) +EXPOSE 80 + +# Start Nginx +CMD ["nginx", "-g", "daemon off;"] diff --git a/README.md b/README.md index c4edd7d8..254f8793 100644 --- a/README.md +++ b/README.md @@ -11,5 +11,21 @@ Run during development: `ng serve --open` +Run Kukai through Docker container, follow this: + +Building the image: + +`docker build -t kukai-wallet:latest .` + +Running the container: + +`docker run -d -p 4200:80 --name kukai-cont kukai-wallet:latest` + +OR +Directly run the container using docker compose + +`docker compose up -d` + + ## Latest Audit -[Least Authority](audit/Least%20Authority%20-%20Tezos%20Foundation%20Kukai%20Wallet%20Final%20Audit%20Report.pdf) (2022-03-04) \ No newline at end of file +[Least Authority](audit/Least%20Authority%20-%20Tezos%20Foundation%20Kukai%20Wallet%20Final%20Audit%20Report.pdf) (2022-03-04) diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..00d63f77 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,7 @@ +services: + kukai-angular-app: + build: + context: . + dockerfile: Dockerfile + ports: + - "4200:80" diff --git a/package.json b/package.json index 7a84e9ce..bb69eb3e 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "start": "ng serve --open --watch", "start:https": "ng build --watch && http-server -S -C RootCA.pem -K RootCA.key -p 3000 -c-1 dist", "build-prod": "node --max_old_space_size=4096 ./node_modules/@angular/cli/bin/ng build --configuration production", + "build-prod-memory": "node ./node_modules/@angular/cli/bin/ng build --configuration production", "build-testnet": "node --max_old_space_size=4096 ./node_modules/@angular/cli/bin/ng build --configuration testnet", "build-mainnet": "node --max_old_space_size=4096 ./node_modules/@angular/cli/bin/ng build --configuration mainnet", "build-dev": "npm run build-testnet",