fix: pure docker based development

This commit is contained in:
Andras Bacsai 2022-10-05 09:01:17 +00:00
parent 86eebb35cb
commit 02c42a7e3a
5 changed files with 59 additions and 4 deletions

27
Dockerfile-dev Normal file
View File

@ -0,0 +1,27 @@
ARG PNPM_VERSION=7.11.0
ARG NPM_VERSION=8.19.1
FROM node:18-slim
ENV NODE_ENV development
ARG TARGETPLATFORM
WORKDIR /app
RUN npm --no-update-notifier --no-fund --global install pnpm@${PNPM_VERSION}
RUN apt update && apt -y install --no-install-recommends ca-certificates git git-lfs openssh-client curl jq cmake sqlite3 openssl psmisc python3
RUN apt-get clean autoclean && apt-get autoremove --yes && rm -rf /var/lib/{apt,dpkg,cache,log}/
RUN npm --no-update-notifier --no-fund --global install pnpm@${PNPM_VERSION}
RUN npm install -g npm@${PNPM_VERSION}
RUN mkdir -p ~/.docker/cli-plugins/
# https://download.docker.com/linux/static/stable/
RUN curl -SL https://cdn.coollabs.io/bin/$TARGETPLATFORM/docker-20.10.9 -o /usr/bin/docker
# https://github.com/docker/compose/releases
# Reverted to 2.6.1 because of this https://github.com/docker/compose/issues/9704. 2.9.0 still has a bug.
RUN curl -SL https://cdn.coollabs.io/bin/$TARGETPLATFORM/docker-compose-linux-2.6.1 -o ~/.docker/cli-plugins/docker-compose
RUN chmod +x ~/.docker/cli-plugins/docker-compose /usr/bin/docker
RUN (curl -sSL "https://github.com/buildpacks/pack/releases/download/v0.27.0/pack-v0.27.0-linux.tgz" | tar -C /usr/local/bin/ --no-same-owner -xzv pack)
EXPOSE 3000
ENV CHECKPOINT_DISABLE=1

View File

@ -20,7 +20,7 @@ import { scheduler } from './scheduler';
import { supportedServiceTypesAndVersions } from './services/supportedVersions'; import { supportedServiceTypesAndVersions } from './services/supportedVersions';
import { includeServices } from './services/common'; import { includeServices } from './services/common';
export const version = '3.10.14'; export const version = '3.10.15';
export const isDev = process.env.NODE_ENV === 'development'; export const isDev = process.env.NODE_ENV === 'development';
const algorithm = 'aes-256-ctr'; const algorithm = 'aes-256-ctr';

View File

@ -1,6 +1,30 @@
version: '3.8' version: '3.8'
services: services:
coolify:
build:
context: .
dockerfile: Dockerfile-dev
command: pnpm dev:container
env_file: apps/api/.env
environment:
- GITPOD_WORKSPACE_URL=${GITPOD_WORKSPACE_URL}
- CODESANDBOX_HOST=${CODESANDBOX_HOST}
container_name: coolify
ports:
- target: 3000
published: 3000
protocol: tcp
mode: host
- target: 3001
published: 3001
protocol: tcp
mode: host
volumes:
- ./:/app
- '/var/run/docker.sock:/var/run/docker.sock'
networks:
- coolify-infra
fluent-bit: fluent-bit:
image: coollabsio/coolify-fluent-bit:1.0.0 image: coollabsio/coolify-fluent-bit:1.0.0
command: /fluent-bit/bin/fluent-bit -c /fluent-bit/etc/fluent-bit-dev.conf command: /fluent-bit/bin/fluent-bit -c /fluent-bit/etc/fluent-bit-dev.conf

View File

@ -1,7 +1,7 @@
{ {
"name": "coolify", "name": "coolify",
"description": "An open-source & self-hostable Heroku / Netlify alternative.", "description": "An open-source & self-hostable Heroku / Netlify alternative.",
"version": "3.10.14", "version": "3.10.15",
"license": "Apache-2.0", "license": "Apache-2.0",
"repository": "github:coollabsio/coolify", "repository": "github:coollabsio/coolify",
"scripts": { "scripts": {
@ -15,7 +15,8 @@
"format:api": "NODE_ENV=development pnpm run --filter api format", "format:api": "NODE_ENV=development pnpm run --filter api format",
"lint": "run-p -l -n lint:*", "lint": "run-p -l -n lint:*",
"lint:api": "NODE_ENV=development pnpm run --filter api lint", "lint:api": "NODE_ENV=development pnpm run --filter api lint",
"dev": "run-p -l -n dev:*", "dev:container": "pnpm install && pnpm db:push && pnpm db:seed && pnpm dev",
"dev": "run-p -l -n dev:api dev:ui",
"dev:api": "NODE_ENV=development pnpm run --filter api dev", "dev:api": "NODE_ENV=development pnpm run --filter api dev",
"dev:ui": "NODE_ENV=development pnpm run --filter ui dev", "dev:ui": "NODE_ENV=development pnpm run --filter ui dev",
"build": "NODE_ENV=production run-p -n build:*", "build": "NODE_ENV=production run-p -n build:*",
@ -34,6 +35,7 @@
"docker", "docker",
"self-host", "self-host",
"iaas", "iaas",
"paas",
"heroku", "heroku",
"netlify", "netlify",
"open-source", "open-source",

View File

@ -104,6 +104,7 @@ importers:
node-os-utils: 1.3.7 node-os-utils: 1.3.7
p-all: 4.0.0 p-all: 4.0.0
p-throttle: 5.0.0 p-throttle: 5.0.0
prisma: 4.4.0
public-ip: 6.0.1 public-ip: 6.0.1
pump: 3.0.0 pump: 3.0.0
ssh-config: 4.1.6 ssh-config: 4.1.6
@ -120,7 +121,6 @@ importers:
eslint-plugin-prettier: 4.2.1_tgumt6uwl2md3n6uqnggd6wvce eslint-plugin-prettier: 4.2.1_tgumt6uwl2md3n6uqnggd6wvce
nodemon: 2.0.20 nodemon: 2.0.20
prettier: 2.7.1 prettier: 2.7.1
prisma: 4.4.0
rimraf: 3.0.2 rimraf: 3.0.2
tsconfig-paths: 4.1.0 tsconfig-paths: 4.1.0
typescript: 4.8.4 typescript: 4.8.4
@ -532,6 +532,7 @@ packages:
/@prisma/engines/4.4.0: /@prisma/engines/4.4.0:
resolution: {integrity: sha512-Fpykccxlt9MHrAs/QpPGpI2nOiRxuLA+LiApgA59ibbf24YICZIMWd3SI2YD+q0IAIso0jCGiHhirAIbxK3RyQ==} resolution: {integrity: sha512-Fpykccxlt9MHrAs/QpPGpI2nOiRxuLA+LiApgA59ibbf24YICZIMWd3SI2YD+q0IAIso0jCGiHhirAIbxK3RyQ==}
requiresBuild: true requiresBuild: true
dev: false
/@rollup/pluginutils/4.2.1: /@rollup/pluginutils/4.2.1:
resolution: {integrity: sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==} resolution: {integrity: sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==}
@ -5078,6 +5079,7 @@ packages:
requiresBuild: true requiresBuild: true
dependencies: dependencies:
'@prisma/engines': 4.4.0 '@prisma/engines': 4.4.0
dev: false
/private/0.1.8: /private/0.1.8:
resolution: {integrity: sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==} resolution: {integrity: sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==}