Skip to content

Instantly share code, notes, and snippets.

@hbt
Created November 9, 2017 19:29
Show Gist options
  • Save hbt/3eb4bbac52c6c06a691be07b5481c1e1 to your computer and use it in GitHub Desktop.
Save hbt/3eb4bbac52c6c06a691be07b5481c1e1 to your computer and use it in GitHub Desktop.
version: '3'
services:
video-converter:
build:
context: .
image: hbtlabs/video-converter
user: user
volumes:
- .:/home/user/project
- $HOME/gdrive/.gd/credentials.json:/home/user/credentials.json
FROM ubuntu:16.04
RUN apt-get update && apt-get install -y curl git python g++ build-essential python-pip ffmpeg sudo php7.0
# install youtube-dl
RUN pip install youtube-dl
# Install drive
RUN mkdir -p /goroot && \
curl https://storage.googleapis.com/golang/go1.8.1.linux-amd64.tar.gz | tar xvzf - -C /goroot --strip-components=1
ENV GOROOT /goroot
ENV GOPATH /gopath
ENV PATH $GOROOT/bin:$GOPATH/bin:$PATH
RUN go get -u github.com/odeke-em/drive/cmd/drive
# Add a user that can `sudo`.
RUN useradd --create-home --shell /bin/bash user \
&& echo "user ALL=(ALL:ALL) NOPASSWD: ALL" > /etc/sudoers.d/use
# Don't be root.
USER user
ENV HOME /home/user
RUN mkdir /home/user/project
WORKDIR /home/user/project
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment