mirror of
https://github.com/codex-team/codex.docs.git
synced 2025-07-21 22:29:40 +02:00
add docker config and CI config (#109)
This commit is contained in:
parent
417ab0688b
commit
e27bc52388
3 changed files with 48 additions and 0 deletions
23
.github/workflows/build-and-push.yml
vendored
Normal file
23
.github/workflows/build-and-push.yml
vendored
Normal 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
13
docker-compose.yml
Normal 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
12
docker/Dockerfile.prod
Normal 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"]
|
Loading…
Add table
Add a link
Reference in a new issue