From f27a2871d74e5117fc029be82caef12246e10879 Mon Sep 17 00:00:00 2001 From: undergroundwires Date: Tue, 14 Jul 2020 17:59:21 +0100 Subject: [PATCH] simplified docker builds --- Dockerfile | 12 ++---------- README.md | 20 ++++++++++---------- 2 files changed, 12 insertions(+), 20 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5628d24c..f617d791 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,20 +1,12 @@ -# +-+-+-+-+-+ +-+-+-+-+-+ -# |B|u|i|l|d| |S|t|a|g|e| -# +-+-+-+-+-+ +-+-+-+-+-+ +# Build FROM node:lts-alpine as build-stage WORKDIR /app COPY package*.json ./ RUN npm install COPY . . RUN npm run build -# For testing purposes, it's easy to run http-server on lts-alpine such as continuing from here: -# RUN npm install -g http-server -# EXPOSE 8080 -# CMD [ "http-server", "dist" ] -# +-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+ -# |P|r|o|d|u|c|t|i|o|n| |S|t|a|g|e| -# +-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+ +# Production stage FROM nginx:stable-alpine as production-stage COPY --from=build-stage /app/dist /usr/share/nginx/html EXPOSE 80 diff --git a/README.md b/README.md index 4f68f72d..fd319b51 100644 --- a/README.md +++ b/README.md @@ -28,16 +28,16 @@ Fork it & add more scripts in [application.yaml](src/application/application.yam ## Commands -- Setup and run - - For development: - - `npm install` to project setup. - - `npm run serve` to compile & hot-reload for development. - - Production (using Docker): - - Build `docker build -t undergroundwires/privacy.sexy .` - - Run `docker run -it -p 8080:8080 --rm --name privacy.sexy-1 undergroundwires/privacy.sexy` -- Prepare for production: `npm run build` -- Run tests: `npm run test:unit` -- Lint and fix files: `npm run lint` +- Project setup: `npm install` +- Testing + - Run unit tests: `npm run test:unit` + - Lint: `npm run lint` +- **Webpage** + - Development: `npm run serve` to compile & hot-reload for development. + - Production: `npm run build` to prepare files for distribution. + - Or run using Docker: + 1. Build: `docker build -t undergroundwires/privacy.sexy:0.4.8 .` + 2. Run: `docker run -it -p 8080:80 --rm --name privacy.sexy-0.4.8 undergroundwires/privacy.sexy:0.4.8` ## Architecture