Let Dockerfile to the build #4
6 changed files with 32 additions and 10 deletions
|
@ -3,3 +3,8 @@
|
||||||
.gitignore
|
.gitignore
|
||||||
.git
|
.git
|
||||||
docker-compose.build.yml
|
docker-compose.build.yml
|
||||||
|
node_modules/
|
||||||
|
.env.example
|
||||||
|
LICENSE.md
|
||||||
|
docker-compose.yml
|
||||||
|
README.md
|
1
.env.example
Normal file
1
.env.example
Normal file
|
@ -0,0 +1 @@
|
||||||
|
TAG=0.0.1
|
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -1,3 +1,4 @@
|
||||||
node_modules/
|
node_modules/
|
||||||
dist/
|
dist/
|
||||||
service-worker.build.js
|
service-worker.build.js
|
||||||
|
.env
|
|
@ -1,13 +1,10 @@
|
||||||
pipeline:
|
pipeline:
|
||||||
build:
|
build:
|
||||||
image: node:20.2.0-alpine3.16
|
image: alpine:3.14
|
||||||
secrets: [docker_password, docker_username]
|
secrets: [docker_password, docker_username]
|
||||||
commands:
|
commands:
|
||||||
# Install deps
|
# Install deps
|
||||||
- apk add docker docker-compose jq
|
- apk add docker docker-compose jq
|
||||||
# Build app
|
|
||||||
- yarn install --frozen-lockfile
|
|
||||||
- yarn build
|
|
||||||
# Log into docker registry
|
# Log into docker registry
|
||||||
- echo "$${DOCKER_PASSWORD}" | docker login --password-stdin --username "$${DOCKER_USERNAME}" git.webdeploy.it
|
- echo "$${DOCKER_PASSWORD}" | docker login --password-stdin --username "$${DOCKER_USERNAME}" git.webdeploy.it
|
||||||
- echo "TAG=$(jq -r .version ./package.json)" >> .env
|
- echo "TAG=$(jq -r .version ./package.json)" >> .env
|
||||||
|
|
19
Dockerfile
19
Dockerfile
|
@ -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
|
EXPOSE 80
|
||||||
|
CMD ["nginx","-g","daemon off;"]
|
||||||
RUN rm -rf /usr/share/nginx/html/*
|
|
||||||
|
|
||||||
COPY ./dist/ /usr/share/nginx/html/
|
|
||||||
|
|
9
docker-compose.prod.yml
Normal file
9
docker-compose.prod.yml
Normal 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
|
Loading…
Reference in a new issue