1
0
Fork 0
mirror of https://github.com/codex-team/codex.docs.git synced 2025-07-19 05:09:41 +02:00

add docker config and CI config (#109)

This commit is contained in:
Nikita Melnikov 2020-11-23 14:09:33 +03:00 committed by GitHub
parent 417ab0688b
commit e27bc52388
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 48 additions and 0 deletions

23
.github/workflows/build-and-push.yml vendored Normal file
View file

@ -0,0 +1,23 @@
name: Build and deploy
on: [push]
env:
DOCKER_REPO: ${{ secrets.DOCKER_USERNAME }}/codex-docs
jobs:
build_and_deploy:
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Build and push docker image
uses: docker/build-push-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: ${{ env.DOCKER_REPO }}
tag_with_ref: true
dockerfile: docker/Dockerfile.prod
push: ${{ endsWith(github.ref, '/stage') || endsWith(github.ref, '/prod') }}

13
docker-compose.yml Normal file
View file

@ -0,0 +1,13 @@
version: "3.2"
services:
docs:
build:
dockerfile: docker/Dockerfile.prod
context: .
ports:
- 5000:3000
volumes:
- ./.codexdocsrc:/usr/src/app/.codexdocsrc:ro
- ./config/production.json:/usr/src/app/config/production.json:ro
- ./public/uploads:/usr/src/app/public/uploads
- ./.db:/usr/src/app/.db

12
docker/Dockerfile.prod Normal file
View file

@ -0,0 +1,12 @@
FROM node:12.14.1-alpine3.11
WORKDIR /usr/src/app
RUN apk add --no-cache git gcc g++ python make musl-dev
COPY package.json yarn.lock ./
RUN yarn install --prod
COPY . .
CMD ["yarn", "start"]