I'm running sudo docker-compose
on my production server to start up my Go container. I have sudo access in my production server but am not the root user.
error:
go_1 | /bin/sh: ./: Permission denied
docker-compose.yml
go:
build:
context: ./api
args:
app_env: ${APP_ENV}
volumes:
- ./api:/go/src/myproject/api
expose:
- "8080"
Go Dockerfile
From golang:1.8.3-alpine3.6
RUN apk update && \
apk add \
bash \
build-base \
curl \
make \
git \
&& rm -rf /var/cache/apk/*
ARG app_env
ENV APP_ENV $app_env
COPY . /go/src/myproject/api
WORKDIR /go/src/myproject/api
CMD if [ ${APP_ENV} = prod ]; \
then \
./; \
else \
go get github.com/pilu/fresh && \
fresh; \
fi
EXPOSE 8080
Any ideas on how to resolve this?