Compare commits

...

13 commits

Author SHA1 Message Date
5280d47c1d Merge pull request 'Let Dockerfile to the build' (#4) from move-docker-compose into main
All checks were successful
ci/woodpecker/push/build Pipeline was successful
Reviewed-on: #4
2023-06-27 15:59:44 +02:00
6af005c1a0 Merge branch 'main' into move-docker-compose
Some checks failed
ci/woodpecker/pr/build Pipeline failed
2023-06-27 15:51:46 +02:00
de2b7fd616 Major version udpate Bump deps 2023-06-10 06:16:33 +02:00
228b0fa6ba fix compose 2023-05-31 21:00:05 +02:00
68879a8faf Rename prod compose 2023-05-31 20:49:35 +02:00
5f7d957db3 Add more things to .dockerignore
I think this is way we should building the project inside a subfolder
2023-05-31 20:48:25 +02:00
a4c19fc381 Add node_modules to dockerignore 2023-05-31 20:47:19 +02:00
9ef2000326 Add .env to gitignore 2023-05-31 20:46:06 +02:00
f5ee1f9a01 Use smaller container for build 2023-05-31 20:44:50 +02:00
0240a9759c Add example 2023-05-31 20:43:32 +02:00
7c25b57d98 Add .env.example 2023-05-31 20:43:23 +02:00
b4b1ebd36b Let the dockerfile do the build 2023-05-31 20:43:04 +02:00
50fd574a8e From infra iac 2023-05-31 20:40:17 +02:00
8 changed files with 723 additions and 706 deletions

View file

@ -3,3 +3,8 @@
.gitignore
.git
docker-compose.build.yml
node_modules/
.env.example
LICENSE.md
docker-compose.yml
README.md

1
.env.example Normal file
View file

@ -0,0 +1 @@
TAG=0.0.1

3
.gitignore vendored
View file

@ -1,3 +1,4 @@
node_modules/
dist/
service-worker.build.js
service-worker.build.js
.env

View file

@ -1,13 +1,10 @@
pipeline:
build:
image: node:20.2.0-alpine3.16
image: alpine:3.14
secrets: [docker_password, docker_username]
commands:
# Install deps
- apk add docker docker-compose jq
# Build app
- yarn install --frozen-lockfile
- yarn build
# Log into docker registry
- echo "$${DOCKER_PASSWORD}" | docker login --password-stdin --username "$${DOCKER_USERNAME}" git.webdeploy.it
- echo "TAG=$(jq -r .version ./package.json)" >> .env

View file

@ -1,7 +1,16 @@
FROM nginx
FROM node:18 AS build
WORKDIR /usr
COPY package.json ./
COPY yarn.lock ./
RUN yarn install --frozen-lockfile
COPY . ./
RUN yarn build
FROM nginx:alpine
COPY --from=build /usr/dist /usr/share/nginx/html
#COPY nginx.conf /etc/nginx/nginx.conf
EXPOSE 80
RUN rm -rf /usr/share/nginx/html/*
COPY ./dist/ /usr/share/nginx/html/
CMD ["nginx","-g","daemon off;"]

9
docker-compose.prod.yml Normal file
View file

@ -0,0 +1,9 @@
version: '3'
services:
web-app:
image: git.webdeploy.it/pianello/pianello-web-app:latest
restart: always
container_name: pianello-web-app
ports:
- 127.0.0.1:8080:80

View file

@ -9,7 +9,7 @@
},
"devDependencies": {
"vite": "^4.3.2",
"workbox-build": "^6.6.1",
"workbox-precaching": "^6.6.1"
"workbox-build": "^7.0.0",
"workbox-precaching": "^7.0.0"
}
}

1383
yarn.lock

File diff suppressed because it is too large Load diff