Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 7 docker #8

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.git
47 changes: 47 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: CI
on:
push:
branches:
- main
tags:
- v*
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node: [ '14' ]
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup node
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}

- name: Prepare
run: yarn install

- name: Lint
run: yarn lint:ts

- name: Build
run: yarn build

- name: Generate
run: yarn generate

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Build Docker
id: docker_build
uses: docker/build-push-action@v2
with:
push: false
tags: devjang/nuxt-realworld:latest
16 changes: 16 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM node:14-alpine as builder
WORKDIR /app
COPY . .
RUN yarn install --production


FROM node:14-alpine
WORKDIR /app
COPY --from=builder /app .

ENV NODE_ENV production
ENV NUXT_PORT 80
ENV HOST 0.0.0.0
EXPOSE 80

CMD [ "yarn", "start" ]