Skip to content

Commit

Permalink
Created Dockerfile and updated ReadMe
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 c26c151 commit c1b2f7e
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 2 deletions.
22 changes: 22 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM alpine:3

# Setup env
ENV NODE_OPTIONS=--openssl-legacy-provider

# Install Node and npm
RUN apk add --update autoconf automake build-base libtool nasm pkgconf nodejs npm git && rm -rf /var/cache/apk/*

# Change workdir to have separate place for app
WORKDIR /gitops-website

# Add required files
ADD . .

# Install dependencies
RUN npm i

# Expose port for server
EXPOSE 8000

# Create entrypoint
ENTRYPOINT ["npm", "start"]
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,12 @@ npm start
yarn install
yarn start
```

**Docker setup**
```shell
# Build docker image from local filesystem
docker build . --no-cache -t website:latest

# Run docker image with mapping port 80 on your computer
docker run -dit -p 0.0.0.0:80:8000 website:latest
```
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
],
"scripts": {
"develop": "gatsby develop",
"start": "gatsby develop",
"start": "gatsby develop --host=0.0.0.0",
"build": "gatsby build",
"serve": "gatsby serve",
"clean": "gatsby clean",
Expand Down Expand Up @@ -58,4 +58,4 @@
"postcss": "^8.3.5",
"tailwindcss": "^2.2.2"
}
}
}

0 comments on commit c1b2f7e

Please sign in to comment.