Skip to content

Commit

Permalink
PR requested changes
Browse files Browse the repository at this point in the history
Signed-off-by: Veinar <[email protected]>
  • Loading branch information
Veinar committed Nov 8, 2023
1 parent c1b2f7e commit dbf2bd6
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 26 deletions.
32 changes: 32 additions & 0 deletions Containerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Use the NODE_VERSION argument to specify the Node.js version
ARG NODE_VERSION

# Use the specified Node.js version as the base image
FROM node:${NODE_VERSION}-alpine

# Set Node args
ENV NODE_OPTIONS=--openssl-legacy-provider

RUN apk add --update autoconf automake build-base libtool nasm pkgconf && \
rm -rf /var/cache/apk/*

# Setup work directory
WORKDIR /gitops-website

# Set permissions for non-root user
RUN chown -R node:node /gitops-website

# Switch user to non-root
USER node

# Add repo files with correct user:group ownership
ADD --chown=node:node . .

# Install dependencies
RUN npm ci

# Expose port for server
EXPOSE 8000

# Create entrypoint
ENTRYPOINT ["npm", "start"]
22 changes: 0 additions & 22 deletions Dockerfile

This file was deleted.

8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ yarn start

**Docker setup**
```shell
# Build docker image from local filesystem
docker build . --no-cache -t website:latest
# Build container image from local filesystem with Node version as build arg
docker build --build-arg NODE_VERSION=19 --no-cache -t website:<tag> -f Containerfile .

# Run docker image with mapping port 80 on your computer
docker run -dit -p 0.0.0.0:80:8000 website:latest
# Run container image with mapping port 80 on your computer
docker run -dit -p 80:8000 website:<tag>
```

0 comments on commit dbf2bd6

Please sign in to comment.