feat: docker builds

This commit is contained in:
Kieran 2023-11-27 20:00:59 +00:00
parent 31f898bf90
commit faef2b5969
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941
3 changed files with 57 additions and 0 deletions

44
.drone.yml Normal file
View File

@ -0,0 +1,44 @@
kind: pipeline
type: kubernetes
name: docker
concurrency:
limit: 1
trigger:
branch:
- main
event:
- push
metadata:
namespace: git
steps:
- name: Fetch tags
image: alpine/git
commands:
- git fetch --tags
- name: Build site
image: node:current-bullseye
volumes:
- name: cache
path: /cache
environment:
YARN_CACHE_FOLDER: /cache/.yarn-docker
commands:
- yarn install
- yarn build
- name: build docker image
image: r.j3ss.co/img
privileged: true
volumes:
- name: cache
path: /cache
environment:
TOKEN:
from_secret: docker_hub
commands:
- img login -u voidic -p $TOKEN
- img build -t voidic/dtan:latest --platform linux/amd64,linux/arm64 .
- img push voidic/dtan:latest
volumes:
- name: cache
claim:
name: docker-cache

3
Dockerfile Normal file
View File

@ -0,0 +1,3 @@
FROM nginxinc/nginx-unprivileged:mainline-alpine
COPY dist /usr/share/nginx/html
COPY docker/nginx.conf /etc/nginx/conf.d/default.conf

10
docker/nginx.conf Normal file
View File

@ -0,0 +1,10 @@
server {
listen 8080 default_server;
server_name _;
root /usr/share/nginx/html;
index index.html;
location / {
try_files $uri $uri/ /index.html =404;
}
}