Skip to content

Instantly share code, notes, and snippets.

@tluyben
Created March 25, 2024 10:21
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tluyben/888408b9105b059d7993df77ed38f7ad to your computer and use it in GitHub Desktop.
Save tluyben/888408b9105b059d7993df77ed38f7ad to your computer and use it in GitHub Desktop.
Codel docker-compose start
version: '3.5'
services:
codel:
build:
context: .
dockerfile: Dockerfile
restart: always
ports:
- "5173:5173"
volumes:
- ./.env:/app/codel/backend/.env
- ./.env.local:/app/codel/frontend/.env.local
- /var/run/docker.sock:/var/run/docker.sock
db:
image: postgres
restart: always
environment:
POSTGRES_PASSWORD: root
POSTGRES_DB: codel
volumes:
- "./pg:/var/lib/postgresql/data"
FROM node:20.11.1-bookworm-slim
ENV NODE_ENV=development
WORKDIR /app
RUN apt update
RUN apt install -y build-essential
RUN apt install -y vim wget lynx curl mariadb-client git bash
RUN npm i -g ts-node
RUN npm i -g jest
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
# this is needed for docker-in-docker
RUN curl -sSL https://get.docker.com/ | sh
RUN wget https://go.dev/dl/go1.22.1.linux-amd64.tar.gz
#RUN wget https://go.dev/dl/go1.22.1.linux-arm64.tar.gz
RUN rm -rf /usr/local/go && tar -C /usr/local -xzf go1.22.1.linux-amd64.tar.gz
#RUN rm -rf /usr/local/go && tar -C /usr/local -xzf go1.22.1.linux-arm64.tar.gz
RUN echo "export PATH=$PATH:/usr/local/go/bin" >> /root/.bashrc
RUN git clone https://github.com/semanser/codel.git
ENV DOCKER_API_VERSION=1.43
WORKDIR /app/codel
COPY start-codel .
RUN chmod 755 start-codel
CMD [ "bash", "-c", "./start-codel" ]
#!/bin/bash
export PATH=$PATH:/usr/local/go/bin
cd backend
go run . &
cd ../frontend
yarn
yarn dev --host 0.0.0.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment