Skip to content

Commit

Permalink
repo: dockerfile & build
Browse files Browse the repository at this point in the history
  • Loading branch information
ivynya committed Aug 16, 2023
1 parent 0b08871 commit 38f63b4
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 10 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Build and Push Docker Image to GHCR

on:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Login to GHCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build Docker image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ghcr.io/${{ github.repository }}:latest

20 changes: 10 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@

FROM denoland/deno:alpine-1.23.1

EXPOSE 8000

# Use the official Golang image as the base image
FROM golang:1.21-alpine as builder
WORKDIR /app

COPY deps.ts .
COPY . .
RUN go build ./cmd/redirect

RUN deno cache deps.ts
RUN deno cache main.ts
# Use slim alpine image for production
FROM alpine:3.18 as production
WORKDIR /app
COPY --from=builder /app/redirect .
EXPOSE 3000

CMD ["run", "-A", "main.ts"]
# Run the Go program when the container starts
CMD ["./redirect"]

1 comment on commit 38f63b4

@deno-deploy
Copy link

@deno-deploy deno-deploy bot commented on 38f63b4 Aug 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Failed to deploy:

Module not found "file:///src/main.ts".

Please sign in to comment.