Skip to content

Commit

Permalink
Improve skaffold config (#17)
Browse files Browse the repository at this point in the history
* improve skaffold config

Signed-off-by: Jari Kolehmainen <[email protected]>

* improve skaffold config

Signed-off-by: Jari Kolehmainen <[email protected]>
  • Loading branch information
jakolehm authored Apr 14, 2021
1 parent b5d9de3 commit 9b0ea11
Show file tree
Hide file tree
Showing 5 changed files with 501 additions and 15 deletions.
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ RUN mkdir /app
WORKDIR /app

COPY . /app
RUN apk add --update python gcc g++ make && yarn install --frozen-lockfile && yarn dist
RUN apk add --update python gcc g++ make && \
yarn install --frozen-lockfile && \
yarn dist && \
yarn install --frozen-lockfile --prod

FROM node:14-alpine

Expand All @@ -13,7 +16,6 @@ WORKDIR /app

COPY package.json yarn.lock ./
COPY --from=build /app/node_modules /app/node_modules
RUN yarn install --frozen-lockfile --prod
COPY --from=build /app/dist /app/dist

ENTRYPOINT [ "/usr/local/bin/node" ]
Expand Down
10 changes: 10 additions & 0 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM node:14-alpine

RUN mkdir /app
WORKDIR /app

COPY . /app
RUN apk add --update python gcc g++ make && \
yarn install --frozen-lockfile

CMD ["yarn", "dev"]
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"main": "dist/index.js",
"license": "MIT",
"scripts": {
"dev": "yarn ts-node index.ts",
"dev": "nodemon --watch index.ts --watch src/ ./node_modules/.bin/ts-node index.ts",
"dist": "yarn tsc",
"test": "yarn jest",
"build-image": "docker build -t bored:latest .",
Expand All @@ -20,6 +20,7 @@
"eslint-plugin-unused-imports": "^1.0.1",
"got": "^11.8.2",
"jest": "^26.6.3",
"nodemon": "^2.0.7",
"ts-jest": "^26.5.3",
"ts-node": "^9.1.1",
"typescript": "^4.1.5"
Expand Down
5 changes: 4 additions & 1 deletion skaffold.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,18 @@ metadata:
build:
artifacts:
- image: bored
docker:
dockerfile: Dockerfile.dev
sync:
infer:
- ".dockerignore"
- "src/**/*"
- "src/**/*.ts"
- "*.ts"
- "*.js*"
- "yarn.*"
local:
useBuildkit: true
push: false
deploy:
kubectl:
manifests:
Expand Down
Loading

0 comments on commit 9b0ea11

Please sign in to comment.