Skip to content

Commit 8ffe8c3

Browse files
committed
sync
1 parent 021e929 commit 8ffe8c3

File tree

6 files changed

+41
-19
lines changed

6 files changed

+41
-19
lines changed

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules/
2+
Dockerfile

.github/workflows/docker-publish.yml

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,28 +12,33 @@ env:
1212
IMAGE_NAME: ghcr.io/${{ github.repository }}
1313

1414
jobs:
15-
test:
16-
runs-on: ubuntu-latest
17-
steps:
18-
- uses: actions/checkout@v2
15+
# test:
16+
# runs-on: ubuntu-latest
17+
# steps:
18+
# - uses: actions/checkout@v2
1919

20-
- name: Run tests
21-
run: |
22-
if [ -f docker-compose.test.yml ]; then
23-
docker-compose --file docker-compose.test.yml build
24-
docker-compose --file docker-compose.test.yml run sut
25-
else
26-
docker build . --file Dockerfile
27-
fi
20+
# - name: Run tests
21+
# run: |
22+
# if [ -f docker-compose.test.yml ]; then
23+
# docker-compose --file docker-compose.test.yml build
24+
# docker-compose --file docker-compose.test.yml run sut
25+
# else
26+
# docker build . --file Dockerfile
27+
# fi
2828
push:
29-
needs: test
29+
# needs: test
3030
runs-on: ubuntu-latest
3131
if: github.event_name == 'push'
3232
steps:
3333
- uses: actions/checkout@v2
3434

3535
- name: Build image
36-
run: docker build . --file Dockerfile --tag $IMAGE_NAME
36+
run: |
37+
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
38+
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
39+
[ "$VERSION" == "master" ] && VERSION=latest
40+
echo VERSION=$VERSION
41+
docker build . --file Dockerfile --build-arg APP_VERSION=$VERSION --tag $IMAGE_NAME
3742
3843
- name: Log into registry
3944
run: echo "${{ secrets.PAT }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin

Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
# install && build && purne
33
FROM node:lts-alpine as install-target
44
ENV PATH $PATH:/app/node_modules/.bin
5+
ARG APP_VERSION=$APP_VERSION
6+
ENV APP_VERSION=$APP_VERSION
57
WORKDIR /app
68
COPY src ./src
79
COPY public ./public
@@ -11,6 +13,10 @@ RUN npm run build
1113

1214
# dist
1315
FROM nginx
16+
ARG APP_VERSION=$APP_VERSION
17+
ENV APP_VERSION=$APP_VERSION
18+
ENV NODE_ENV=production
19+
1420
COPY nginx.conf /etc/nginx/nginx.conf
1521
COPY mime.types /etc/nginx/mime.types
1622

docker-compose.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,17 @@ version: "3.6"
22
networks:
33
back:
44
services:
5-
client:
5+
local:
66
image: vue-docker-nginx:latest
77
# environment:
88
# API_URL: http://api.2mx.org/graphql
99
ports:
1010
- 3000:80
1111
networks:
1212
- back
13+
client:
14+
image: ghcr.io/gromov-io/vue-docker-nginx:latest
15+
ports:
16+
- 3001:80
17+
networks:
18+
- back

nginx.conf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ http {
1616
try_files $uri $uri/ /index.html$is_args$args;
1717
}
1818

19-
location ~ ^/api(.*) {
20-
rewrite ^/api/(.*) /$1 break;
21-
proxy_pass https://api.publicapis.org;
22-
}
19+
# location ~ ^/api(.*) {
20+
# rewrite ^/api/(.*) /$1 break;
21+
# proxy_pass https://api.publicapis.org;
22+
# }
2323
}
2424
}

src/App.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
<template>
22
<div id="app">
33
<img alt="Vue logo" src="./assets/logo.png">
4+
<div>
5+
version: <strong></strong>
6+
</div>
47
</div>
58
</template>
69

0 commit comments

Comments
 (0)