Skip to content

Commit bd06e5d

Browse files
albttxleohhhn
andauthored
chore: dockerize (#21)
* chore: dockerize * chore: edit Dockerfile * chore: update tag --------- Co-authored-by: Leon Hudak <[email protected]>
1 parent a7d1e0c commit bd06e5d

File tree

5 files changed

+127
-5
lines changed

5 files changed

+127
-5
lines changed

.github/workflows/docker.yml

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: docker
2+
3+
on:
4+
push:
5+
branches:
6+
- "main"
7+
tags:
8+
- "v*"
9+
10+
jobs:
11+
docker-dev:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v3
16+
17+
- name: Login to GitHub Container Registry
18+
uses: docker/login-action@v2
19+
with:
20+
registry: ghcr.io
21+
username: ${{ github.repository_owner }}
22+
password: ${{ secrets.GITHUB_TOKEN }}
23+
24+
- name: Docker meta
25+
id: meta
26+
uses: docker/metadata-action@v4
27+
with:
28+
images: ghcr.io/${{ github.repository }}
29+
tags: |
30+
type=raw,value=dev
31+
type=semver,pattern=v{{version}}-dev
32+
33+
- name: Build and push
34+
uses: docker/build-push-action@v3
35+
with:
36+
context: .
37+
file: "./Dockerfile"
38+
push: ${{ github.event_name != 'pull_request' }}
39+
tags: ${{ steps.meta.outputs.tags }}
40+
labels: ${{ steps.meta.outputs.labels }}
41+
42+
docker-production:
43+
runs-on: ubuntu-latest
44+
steps:
45+
- name: Checkout
46+
uses: actions/checkout@v3
47+
48+
- name: Login to GitHub Container Registry
49+
uses: docker/login-action@v2
50+
with:
51+
registry: ghcr.io
52+
username: ${{ github.repository_owner }}
53+
password: ${{ secrets.GITHUB_TOKEN }}
54+
55+
- name: Docker meta
56+
id: meta
57+
uses: docker/metadata-action@v4
58+
with:
59+
images: ghcr.io/${{ github.repository }}
60+
tags: |
61+
type=raw,value=latest
62+
type=semver,pattern=v{{version}}
63+
64+
- name: Build and push
65+
uses: docker/build-push-action@v3
66+
with:
67+
context: .
68+
file: "./Dockerfile.production"
69+
push: ${{ github.event_name != 'pull_request' }}
70+
tags: ${{ steps.meta.outputs.tags }}
71+
labels: ${{ steps.meta.outputs.labels }}

.github/workflows/netlify.yml

-5
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@ on:
66
branches:
77
- main
88

9-
env:
10-
MEILISEARCH_URL: ${{ secrets.MEILISEARCH_URL }}
11-
MEILISEARCH_API_KEY: ${{ secrets.MEILISEARCH_API_KEY }}
12-
MEILISEARCH_INDEX_UID: ${{ secrets.MEILISEARCH_INDEX_UID}}
13-
149
jobs:
1510
deploy-netlify:
1611
name: deploy-to-netlify

Dockerfile

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM node:18.18.0-alpine3.18 as build
2+
3+
WORKDIR /app
4+
5+
COPY . .
6+
7+
RUN rm -rf build docs
8+
9+
WORKDIR /app/docusaurus
10+
11+
RUN yarn install
12+
13+
CMD [ "yarn", "start", "--host=0.0.0.0" ]

Dockerfile.production

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM node:18.18.0-alpine3.18 as build
2+
3+
WORKDIR /app
4+
5+
COPY . .
6+
7+
WORKDIR /app/docusaurus
8+
9+
RUN yarn install
10+
RUN yarn build
11+
12+
FROM nginx:stable-alpine
13+
14+
COPY --from=build /app/docusaurus/build /usr/share/nginx/html/

docker-compose.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
version: "3"
2+
3+
services:
4+
docusaurus:
5+
image: ghcr.io/gnolang/docs.gno.land:dev
6+
build:
7+
context: .
8+
volumes:
9+
- .:/app/docs
10+
ports:
11+
- 3000:3000
12+
environment:
13+
- MEILISEARCH_URL="localhost:7700"
14+
- MEILISEARCH_API_KEY="masterKey"
15+
- MEILISEARCH_INDEX_UID="dev"
16+
17+
meilisearch:
18+
image: getmeili/meilisearch
19+
restart: unless-stopped
20+
environment:
21+
- MEILI_MASTER_KEY=masterKey
22+
- MEILI_NO_ANALYTICS=true
23+
- MEILI_ENV=dev
24+
- MEILI_LOG_LEVEL=info
25+
- MEILI_DB_PATH=/data.ms
26+
ports:
27+
- 7700:7700
28+
#volumes:
29+
# - ./data.ms:/data.ms

0 commit comments

Comments
 (0)