Skip to content

Instantly share code, notes, and snippets.

@waptik
Created December 23, 2023 22:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save waptik/93c3d5165c538af1b0e9128c37e92626 to your computer and use it in GitHub Desktop.
Save waptik/93c3d5165c538af1b0e9128c37e92626 to your computer and use it in GitHub Desktop.
Current gitpod configuration files for my deno fresh app
FROM gitpod/workspace-full
RUN curl -fsSL https://deno.land/x/install/install.sh | sh
RUN /home/gitpod/.deno/bin/deno completions bash > /home/gitpod/.bashrc.d/90-deno && \
echo 'export DENO_INSTALL="/home/gitpod/.deno"' >> /home/gitpod/.bashrc.d/90-deno && \
echo 'export PATH="$DENO_INSTALL/bin:$PATH"' >> /home/gitpod/.bashrc.d/90-deno
# Image of workspace. Learn more: https://www.gitpod.io/docs/configure/workspaces/workspace-image
image: #gitpod/workspace-full:latest
file: .gitpod.Dockerfile
# List the start up tasks. Learn more: https://www.gitpod.io/docs/configure/workspaces/tasks
tasks:
- name: Restore .env file # Learn more: https://www.gitpod.io/guides/automate-env-files-with-gitpod-environment-variables#improving-the-developer-experience
command: |
if [ -f .env ]; then
# If this workspace already has a .env, don't override it
# Local changes survive a workspace being opened and closed
# but they will not persist between separate workspaces for the same repo
echo "Found .env in workspace"
else
if [ -z "${DOTENV}" ]; then
# There is no $DOTENV from a previous workspace
# Default to the example .env
echo "Setting example .env"
cp .env.example .env
else
# After making changes to .env, run this line to persist it to $DOTENV
# gp env DOTENV="$(base64 .env | tr -d '\n')"
#
# Environment variables set this way are shared between all your workspaces for this repo
# The lines below will read $DOTENV and print a .env file
echo "Restoring .env from Gitpod"
echo "${DOTENV}" | base64 -d > .env
fi
fi
- name: Cache dependencies
init: deno task cache # runs during prebuild => https://www.gitpod.io/docs/configure/projects/prebuilds
command: deno task start # echo 'start script' # deno task start
# List the ports to expose. Learn more: https://www.gitpod.io/docs/configure/workspaces/ports
ports:
- name: Deno Fresh App
description: Port 8000 for the deno fresh app
port: 8000
onOpen: open-preview
# Learn more from ready-to-use templates: https://www.gitpod.io/docs/introduction/getting-started/quickstart
vscode:
extensions:
- denoland.vscode-deno
- bradlc.vscode-tailwindcss
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment