Skip to content

Commit 124a3f1

Browse files
committed
update dockerfile and add github actions to push image to dockerhub
1 parent 28a6b95 commit 124a3f1

File tree

3 files changed

+51
-18
lines changed

3 files changed

+51
-18
lines changed

.github/workflows/server-ci.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: ci
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
path-context:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Check out the repo
14+
uses: actions/checkout@v2
15+
- name: Set up QEMU
16+
uses: docker/setup-qemu-action@v1
17+
- name: Set up Docker Buildx
18+
uses: docker/setup-buildx-action@v1
19+
- name: Login to DockerHub
20+
uses: docker/login-action@v1
21+
with:
22+
username: ${{ secrets.DOCKERHUB_USERNAME }}
23+
password: ${{ secrets.DOCKERHUB_TOKEN }}
24+
- name: Build and push
25+
id: docker_build
26+
uses: docker/build-push-action@v2
27+
with:
28+
context: ./server
29+
file: ./server/Dockerfile
30+
push: true
31+
tags: koa-vue-fullstack/server:latest
32+
- name: Image digest
33+
run: echo ${{ steps.docker_build.outputs.digest }}

server/Dockerfile

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
# Use an node 8 runtime as a parent image
2-
FROM node:8.9.4
3-
4-
# Set environment vaiable: server port as 3002
5-
ENV AUTH_SECRET=vHJcV7
6-
7-
# Set the working directory to /server
8-
WORKDIR /server
9-
10-
# Copy the current directory contents into the container at /server
11-
ADD . /server
12-
13-
RUN npm install
14-
15-
# Make port 3000 available to the world outside this container
16-
EXPOSE 3000
17-
18-
CMD ["npm", "run", "build"]
1+
# Use an node 10 runtime as a parent image
2+
FROM node:10.12.0
3+
4+
# Set environment vaiable: server port as 3002
5+
ENV AUTH_SECRET=vHJcV7
6+
7+
# Set the working directory to /server
8+
WORKDIR /server
9+
10+
# Copy the current directory contents into the container at /server
11+
ADD . /server
12+
13+
RUN npm install
14+
15+
# Make port 3000 available to the world outside this container
16+
EXPOSE 3000
17+
18+
CMD ["npm", "run", "build"]

server/kubernetes/server.yml

Whitespace-only changes.

0 commit comments

Comments
 (0)