C
Coder.comβ€’2y ago
Sven

First setup issues

Hi! Im trying to install docker-code-server on Coder but it quit on template import provision for start: recv import provision: plan terraform: terraform plan: exit status 1 https://paste.bijsven.nl/hofuzavuya.cpp
352 Replies
Phorcys
Phorcysβ€’2y ago
yeah so can you send over your docker-compose.yml ? you have to set the user value to coder:998 inside the service declaration
services:
coder:
user: coder:998
services:
coder:
user: coder:998
where 998 is the GID of the docker group
Phorcys
Phorcysβ€’2y ago
actually, i didn't know about group_add hmm you should maybe try upping the compose version oh yeah i didn't know about group_add because it doesn't exist anymore it seems
Sven
SvenOPβ€’2y ago
oh i followed the tutorial on the website with gitclone
Sven
SvenOPβ€’2y ago
Okay Just docker-compose up -d ? As root https://paste.bijsven.nl/nutodukogi.rb
Phorcys
Phorcysβ€’2y ago
yup
Sven
SvenOPβ€’2y ago
Get this error That i need to use another version That did i in the config
Phorcys
Phorcysβ€’2y ago
yeah it's 3.8 sorry not 3.9 also your docker-compose is outdated
Sven
SvenOPβ€’2y ago
Again oh Just apt update && apt upgrade -y? Im not that good in Docker πŸ™‚
Phorcys
Phorcysβ€’2y ago
no the package changed actually I think it'd be
apt remove docker-compose
apt install docker-compose-plugin
apt remove docker-compose
apt install docker-compose-plugin
not sure about the remove part and the newer command is docker compose without the -
Sven
SvenOPβ€’2y ago
ah
Phorcys
Phorcysβ€’2y ago
yeah they decided to make it a plugin
Sven
SvenOPβ€’2y ago
Docker-compose is better πŸ˜„ https://paste.bijsven.nl/axenavafoy.rb
Phorcys
Phorcysβ€’2y ago
well you can alias it i guess took me a bit to update my muscle memory
Sven
SvenOPβ€’2y ago
It didn't work I have updated my rep.
Phorcys
Phorcysβ€’2y ago
ubuntu or debian?
Sven
SvenOPβ€’2y ago
Ubuntu Server 20.04 LTS
Phorcys
Phorcysβ€’2y ago
https://docs.docker.com/engine/install/ubuntu/#set-up-the-repository you might have to do that unsure whatever it's not really the point here this one should work -> https://paste.bijsven.nl/ecuwesefit.http
Sven
SvenOPβ€’2y ago
Didn't work
Phorcys
Phorcysβ€’2y ago
same error ?
Sven
SvenOPβ€’2y ago
Yep
Phorcys
Phorcysβ€’2y ago
yeaaah so you'll want to update your compose it's weird that it's not in the repo though does /etc/apt/sources.list.d/docker.list exist on your system ?
Sven
SvenOPβ€’2y ago
Yeah it does
Data: deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu focal stable
https://paste.bijsven.nl/suvamesufa.sql
Phorcys
Phorcysβ€’2y ago
you tried apt update yeah ?
Phorcys
Phorcysβ€’2y ago
i mean it's' in the repo sooo
Sven
SvenOPβ€’2y ago
Soo?
Phorcys
Phorcysβ€’2y ago
it doesn't make sense
Phorcys
Phorcysβ€’2y ago
Docker Documentation
Install the Compose plugin
Download and install Docker Compose on Linux with this step-by-step handbook. This plugin can be installed manually or by using a repository.
Sven
SvenOPβ€’2y ago
Docker Compose version v2.16.0 Installed Deamon has stopped? Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
Phorcys
Phorcysβ€’2y ago
what's outputting that ?
Phorcys
Phorcysβ€’2y ago
you should now be able to use docker compose up -d
Sven
SvenOPβ€’2y ago
Done that
Phorcys
Phorcysβ€’2y ago
nevermind yeah
Sven
SvenOPβ€’2y ago
but then i get that
Phorcys
Phorcysβ€’2y ago
systemctl status docker ?
Phorcys
Phorcysβ€’2y ago
i don't really know hold on is that the same server ?
Sven
SvenOPβ€’2y ago
What do you mean "Same Server"
Phorcys
Phorcysβ€’2y ago
yeah it is
Sven
SvenOPβ€’2y ago
Yeah i got plenty of Docker Containers
Phorcys
Phorcysβ€’2y ago
i thought i saw another hostname
Sven
SvenOPβ€’2y ago
Ohh no its @web
Phorcys
Phorcysβ€’2y ago
this genuinely doesn't make much sense
Sven
SvenOPβ€’2y ago
I know...
Phorcys
Phorcysβ€’2y ago
what does docker info output ?
Phorcys
Phorcysβ€’2y ago
yeah no systemctl restart docker this'll kill all your containers though
Sven
SvenOPβ€’2y ago
No Prolbem Only 5 people that are getting angry 🀣 But i have a warning on the line for today Done
Phorcys
Phorcysβ€’2y ago
try docker info again now
Sven
SvenOPβ€’2y ago
root@web:/home/vs.bijsven.nl# docker info Client: Context: default Debug Mode: false Plugins: compose: Docker Compose (Docker Inc., v2.16.0) Server: ERROR: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? errors pretty printing info Paste server is also down πŸ˜›
Phorcys
Phorcysβ€’2y ago
docker version ?
Sven
SvenOPβ€’2y ago
root@web:/home/vs.bijsven.nl# docker version Client: Version: 20.10.12 API version: 1.41 Go version: go1.16.2 Git commit: 20.10.12-0ubuntu2~20.04.1 Built: Wed Apr 6 02:14:38 2022 OS/Arch: linux/amd64 Context: default Experimental: true Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
Phorcys
Phorcysβ€’2y ago
a bit out of date aswell but that shouldn't be it journalctl -xe -u docker
Sven
SvenOPβ€’2y ago
One sec somethings arent starting up
Phorcys
Phorcysβ€’2y ago
rage quit time
Sven
SvenOPβ€’2y ago
No description
Sven
SvenOPβ€’2y ago
A The docker deamon root@web:/home/vs.bijsven.nl# dockerd INFO[2023-02-18T13:36:31.630053036+01:00] Starting up
failed to start daemon: pid file found, ensure docker is not running or delete /var/run/docker.pid
Phorcys
Phorcysβ€’2y ago
well yeah it isn't running properly that's clear it's likely running in the background still since systemd managed the pidfile it's not deleted
Phorcys
Phorcysβ€’2y ago
what's this UI ? i'm not familiar with this
Sven
SvenOPβ€’2y ago
Portainer root@web:/home/vs.bijsven.nl# /run/docker.sock -bash: /run/docker.sock: Permission denied
Phorcys
Phorcysβ€’2y ago
i don't know it shouldn't have caused that i think maybe update your docker, maybe the compose plugin is failing to load ? no error logs though soo this is so weird
Sven
SvenOPβ€’2y ago
Yeah Maybe i should first do this on my test server πŸ˜…
Phorcys
Phorcysβ€’2y ago
i dunno, it really shouldn't be doing that
Sven
SvenOPβ€’2y ago
Should it make any diffrents when i try to delete that? I have fix it! Its working now!
Phorcys
Phorcysβ€’2y ago
you can try doing systemctl stop docker and try running the docker daemon like you did what fixed it?
Sven
SvenOPβ€’2y ago
I have stopped Docker and docker.socket Docker is up and running
Phorcys
Phorcysβ€’2y ago
alright
Sven
SvenOPβ€’2y ago
No description
Phorcys
Phorcysβ€’2y ago
is your coder deployment running on a domain?
Sven
SvenOPβ€’2y ago
I want to set it on dev.bijsven.nl bijsven means bysven its dutch :D
Phorcys
Phorcysβ€’2y ago
you'll want to edit (or create) the .env file in the same folder as the compose file and add CODER_ACCESS_URL=https://mydomain.tld
Sven
SvenOPβ€’2y ago
I want to use it with a reversed proxy (nginx proxy manager) does that make a diffrents?
Phorcys
Phorcysβ€’2y ago
no that's fine access URL is the URL it's going to be accessed from so coder doesn't care if it's being reverse proxied as long as it's accessible from the given url
Phorcys
Phorcysβ€’2y ago
yup
Sven
SvenOPβ€’2y ago
And now i should can create a workspace? Template
Phorcys
Phorcysβ€’2y ago
don't you already have a template? anyways yeah
Sven
SvenOPβ€’2y ago
nope
Phorcys
Phorcysβ€’2y ago
you can
Sven
SvenOPβ€’2y ago
https://paste.bijsven.nl/qayipoteho.cpp nope Same error as the start
Phorcys
Phorcysβ€’2y ago
can you send your docker compose again?
Sven
SvenOPβ€’2y ago
yeah https://paste.bijsven.nl/pigujuwavu.http oh yeah the adres or no i did that
Phorcys
Phorcysβ€’2y ago
what's the output of id -g docker?
Sven
SvenOPβ€’2y ago
id: β€˜docker’: no such user https://dev.bijsven.nl/ works
Phorcys
Phorcysβ€’2y ago
nevermind wrong command getent group docker
Sven
SvenOPβ€’2y ago
docker:x:119:root
Phorcys
Phorcysβ€’2y ago
lol that's why change coder:998 to coder:119
Sven
SvenOPβ€’2y ago
in the yaml?
Phorcys
Phorcysβ€’2y ago
yup
Sven
SvenOPβ€’2y ago
restart the container?
Phorcys
Phorcysβ€’2y ago
rerun docker compose up -d everytime you change the compose file yeah
Sven
SvenOPβ€’2y ago
Yeah
Sven
SvenOPβ€’2y ago
No description
Sven
SvenOPβ€’2y ago
180 messages πŸ˜›
Phorcys
Phorcysβ€’2y ago
does it work?
Sven
SvenOPβ€’2y ago
Yeah, one more question When i press this button
Sven
SvenOPβ€’2y ago
No description
Sven
SvenOPβ€’2y ago
Its shows white
Phorcys
Phorcysβ€’2y ago
can you show me the URL?
Phorcys
Phorcysβ€’2y ago
it should work try to open devtools (ctrl+shift+i), navigate to the network tab and hit ctrl+r
Sven
SvenOPβ€’2y ago
No description
Sven
SvenOPβ€’2y ago
oh it was taking super long before it loaded but it does load πŸ˜„ And how do you add people to a workspace?
Phorcys
Phorcysβ€’2y ago
i'll let someone else answer since i have never needed to do that cc: @Atif long time no see atif's profile picture
Sven
SvenOPβ€’2y ago
And do you know how to see your HTML CSS JS code on web based view?
Phorcys
Phorcysβ€’2y ago
sorry? you're editing a static site and want to see it?
Sven
SvenOPβ€’2y ago
Yeah like i want to try out my code But how do you view the output of the code like a website
Phorcys
Phorcysβ€’2y ago
you either want to have a web server running like caddy and define a coder_app for it or what i recommend is setting up port forwarding with a wildcard domain and booting a temporary web server on demand
Sven
SvenOPβ€’2y ago
Is there any documentatin for wildcard
Phorcys
Phorcysβ€’2y ago
yes there is, let me find it
Sven
SvenOPβ€’2y ago
thx
Phorcys
Phorcysβ€’2y ago
what do you use to generate tls certs?
Sven
SvenOPβ€’2y ago
SSL certificates?
Phorcys
Phorcysβ€’2y ago
it's called TLS now but yeah well, TLS is SSL's successor
Sven
SvenOPβ€’2y ago
Okay I don't know if i have it The page where coder is located is ssl with Nginx Proxy Manager
Phorcys
Phorcysβ€’2y ago
okay, have you ever sat up wildcard hosts before?
Sven
SvenOPβ€’2y ago
Nope
Phorcys
Phorcysβ€’2y ago
what's your nameservers? (cloudflare, porkbun, google domains, etc)
Sven
SvenOPβ€’2y ago
Cloudflare
Phorcys
Phorcysβ€’2y ago
alright
Phorcys
Phorcysβ€’2y ago
i'm not too familiar with nginx proxy manager, I use Caddy which is simple and fetches certificates for you automagically
Sven
SvenOPβ€’2y ago
I know how it works i think i have working it with 29 other proxy hosts
Sven
SvenOPβ€’2y ago
No description
Phorcys
Phorcysβ€’2y ago
basically your certificates come from let's encrypt usual certificate challenges work by hosting a file on a http server but wildcard requires a different challenge type which is DNS, because it can allow to serve on any subdomain actually you'll want your wildcard to be *.dev.yourdomain i think your coder is exposed on the dev subdomain right?
Sven
SvenOPβ€’2y ago
Yeah
Phorcys
Phorcysβ€’2y ago
alright yeah
Sven
SvenOPβ€’2y ago
do i need to set the SSL to *.dev.bijsven.nl?
Phorcys
Phorcysβ€’2y ago
yes and then have nginx proxy manager reverse proxy *.dev.bijsven.nl to your coder IP
Sven
SvenOPβ€’2y ago
Okay I need to create an cloudflare api token
Sven
SvenOPβ€’2y ago
No description
Phorcys
Phorcysβ€’2y ago
yup like with caddy just set "modify dns" permission for specific zone and select your domain
Sven
SvenOPβ€’2y ago
oh
Phorcys
Phorcysβ€’2y ago
like you did but just set the host
Sven
SvenOPβ€’2y ago
i didn't read further then my nouse if long (i dont know if that is a word in english) (i just translated with my tiny brain πŸ™‚ )
Phorcys
Phorcysβ€’2y ago
No description
Phorcys
Phorcysβ€’2y ago
wdym?
Sven
SvenOPβ€’2y ago
I didn't look longer than my nose is long
Phorcys
Phorcysβ€’2y ago
i understand reading futher than your nose since that exists in french too
Sven
SvenOPβ€’2y ago
πŸ˜‚ Yeah my english is not good
Phorcys
Phorcysβ€’2y ago
oh yeah your way of saying it is just longer
Atif
Atifβ€’2y ago
coder now publishes docs on setting up a wildcard domain with TLS. Let me grab the link
Phorcys
Phorcysβ€’2y ago
i did send it here but i don't think it has instructions for nginx proxy manager yeah it doesn't alright i'll be gone for a bit, i have to return something at a store
Sven
SvenOPβ€’2y ago
Now i think that its working I have followed the hole guide yeah its working πŸ˜„
Sven
SvenOPβ€’2y ago
Whats the next step?
Atif
Atifβ€’2y ago
It has now for apache, ngnix and caddy Please follow one of the guides.
Sven
SvenOPβ€’2y ago
This one?
Atif
Atifβ€’2y ago
This
Sven
SvenOPβ€’2y ago
I have a wildcard tls now
Atif
Atifβ€’2y ago
Everything should work then
Sven
SvenOPβ€’2y ago
What should work?
Sven
SvenOPβ€’2y ago
No description
Phorcys
Phorcysβ€’2y ago
okay so now you should set CODER_WILDCARD_ACCESS_URL=https://*.dev.bijsven.nl in your .env that's something else, you're trying to run the coder server on your own computer
Sven
SvenOPβ€’2y ago
oh oky And then? Restarting the container...
Phorcys
Phorcysβ€’2y ago
yeh then from the web UI, you should be able to use the "port forward" button on your workspace's page
Sven
SvenOPβ€’2y ago
No description
Phorcys
Phorcysβ€’2y ago
how did you restart the container? what command did you use i mean
Sven
SvenOPβ€’2y ago
docker compose stop && docker compose start
Phorcys
Phorcysβ€’2y ago
no you should use down and up instead of those
Sven
SvenOPβ€’2y ago
okay
Phorcys
Phorcysβ€’2y ago
and also running docker compose up -d automatically recreates modified containers without needed to run down
Sven
SvenOPβ€’2y ago
Okay! Done!
Sven
SvenOPβ€’2y ago
No description
Phorcys
Phorcysβ€’2y ago
AFAIK stop and start are deprecated and only restart the container without taking in account config changes that's odd.. let me look at my config
Sven
SvenOPβ€’2y ago
Okay!
Phorcys
Phorcysβ€’2y ago
i think you also need to enable wildcard
Sven
SvenOPβ€’2y ago
What do you mean? In Nginx Proxy Manager or Coder?
Phorcys
Phorcysβ€’2y ago
coder, but i'm wrong oh, my bad!
Sven
SvenOPβ€’2y ago
?
Phorcys
Phorcysβ€’2y ago
it's this but without the https
Sven
SvenOPβ€’2y ago
aah thx
Phorcys
Phorcysβ€’2y ago
@Ben maybe this should be named CODER_WILDCARD_ACCESS_DOMAIN? to prevent from confusion
Sven
SvenOPβ€’2y ago
Restarted...
No description
Phorcys
Phorcysβ€’2y ago
wtf lol can you show me your env file once again
Phorcys
Phorcysβ€’2y ago
oooh no without https:// altogether like just *.dev.bijsven.nl sorry for not making that clear lol
Sven
SvenOPβ€’2y ago
oh np Like this
Sven
SvenOPβ€’2y ago
No description
Sven
SvenOPβ€’2y ago
?
Phorcys
Phorcysβ€’2y ago
nah
CODER_ACCESS_URL=https://dev.bijsven.nl
CODER_WILDCARD_ACCESS_URL=*.dev.bijsven.nl
CODER_ACCESS_URL=https://dev.bijsven.nl
CODER_WILDCARD_ACCESS_URL=*.dev.bijsven.nl
Sven
SvenOPβ€’2y ago
aah
Phorcys
Phorcysβ€’2y ago
it's called URL but it doesn't make sense since it's only the domain that's what I pinged ben about
Sven
SvenOPβ€’2y ago
No description
Phorcys
Phorcysβ€’2y ago
yup
Sven
SvenOPβ€’2y ago
πŸ‘
Phorcys
Phorcysβ€’2y ago
then all should work
Sven
SvenOPβ€’2y ago
No description
Phorcys
Phorcysβ€’2y ago
shoot it can you run docker logs coder for me ?
Sven
SvenOPβ€’2y ago
Error: No such container: coder I should look at Portainer
Phorcys
Phorcysβ€’2y ago
yeah
Sven
SvenOPβ€’2y ago
My internet is very slow. Im sorry I takes so long
Phorcys
Phorcysβ€’2y ago
you're fine
Sven
SvenOPβ€’2y ago
πŸ˜…
Sven
SvenOPβ€’2y ago
Sven
SvenOPβ€’2y ago
vsbijsvennl-coder-1 PostgreSQL Database directory appears to contain a database; Skipping initialization 2023-02-18 15:44:19.263 UTC [1] LOG: starting PostgreSQL 14.2 (Debian 14.2-1.pgdg110+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit 2023-02-18 15:44:19.264 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432 2023-02-18 15:44:19.265 UTC [1] LOG: listening on IPv6 address "::", port 5432 2023-02-18 15:44:19.269 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432" 2023-02-18 15:44:19.288 UTC [25] LOG: database system was shut down at 2023-02-18 15:44:14 UTC 2023-02-18 15:44:19.298 UTC [1] LOG: database system is ready to accept connections database
Phorcys
Phorcysβ€’2y ago
i only needed coder for that but thx
Sven
SvenOPβ€’2y ago
πŸ‘
Phorcys
Phorcysβ€’2y ago
i don't know honestly
Sven
SvenOPβ€’2y ago
hm
Phorcys
Phorcysβ€’2y ago
did you use docker compose up?
Sven
SvenOPβ€’2y ago
Yep docker compose up -d
Phorcys
Phorcysβ€’2y ago
yeah
Sven
SvenOPβ€’2y ago
root@web:/home/vs.bijsven.nl# docker compose up -d [+] Running 2/2 β Ώ Container vsbijsvennl-database-1 Healthy 0.7s β Ώ Container vsbijsvennl-coder-1 Started 1.4s
Phorcys
Phorcysβ€’2y ago
maybe it needs you to setup CODER_ADDRESS=0.0.0.0:7080 replace 7080 with your port actually
Sven
SvenOPβ€’2y ago
7080
Phorcys
Phorcysβ€’2y ago
maybe try restarting the workspace first
Sven
SvenOPβ€’2y ago
is the port Okay
Phorcys
Phorcysβ€’2y ago
maybe that's the reason
Sven
SvenOPβ€’2y ago
And then also the Coder? 133 seconds remaining... done
Phorcys
Phorcysβ€’2y ago
if restarting the workspace doesn't work edit the config and restart coder
Sven
SvenOPβ€’2y ago
With config? When i click on the container its says "Unable to connect" Which config?
Phorcys
Phorcysβ€’2y ago
.env
Sven
SvenOPβ€’2y ago
Okay But what do i need to edit then?
Phorcys
Phorcysβ€’2y ago
try adding this line @Sven
Sven
SvenOPβ€’2y ago
Okay!
Sven
SvenOPβ€’2y ago
No description
Sven
SvenOPβ€’2y ago
Done but now?
Phorcys
Phorcysβ€’2y ago
try to restart but I've got no clue if it has an impact i'll leave this to another member of the server because I don't think I can help
Sven
SvenOPβ€’2y ago
@Atif can you help? Can you do something with this log? vsbijsvennl-coder-1 | WARN: --address and -a are deprecated, please use --http-address and --tls-address insteadStarted HTTP listener at http://0.0.0.0:7080
Phorcys
Phorcysβ€’2y ago
it doesn't matter much, I think it's related to the docker container itself (I have it too)
Sven
SvenOPβ€’2y ago
oh okay, and who can i the best contact for this? Is there some expert on the Docker side of Coder?
Phorcys
Phorcysβ€’2y ago
oh no like i meant it's not the root cause of your issue
Sven
SvenOPβ€’2y ago
Ah, in #πŸš‚οΈ±releases comes the updates. Do you think there is in a feature release a update that fix it?
Phorcys
Phorcysβ€’2y ago
here's my config coder.env
CODER_ADDRESS="0.0.0.0:80"

CODER_ACCESS_URL="https://coder.example.org"
CODER_WILDCARD_ACCESS_URL="*.coder.example.org"

CODER_EXPERIMENTAL=true
CODER_ADDRESS="0.0.0.0:80"

CODER_ACCESS_URL="https://coder.example.org"
CODER_WILDCARD_ACCESS_URL="*.coder.example.org"

CODER_EXPERIMENTAL=true
docker-compose.yml
version: "3.9"

networks:
coder:
external: false
ipam:
driver: default
config:
- subnet: 172.23.0.0/24

volumes:
database:
driver: local

services:
coder:
image: ghcr.io/coder/coder:latest
container_name: coder
user: coder:998
environment:
CODER_PG_CONNECTION_URL: "postgresql://${POSTGRES_USER:-username}:${POSTGRES_PASSWORD:-password}@database/${POSTGRES_DB:-coder}?sslmode=disable"
env_file:
- coder.env
networks:
coder:
ipv4_address: 172.23.0.2
volumes:
- /var/run/docker.sock:/var/run/docker.sock
depends_on:
database:
condition: service_healthy
restart: unless-stopped

database:
image: postgres:14.5-alpine
container_name: coder_db
environment:
POSTGRES_USER: ${POSTGRES_USER:-username}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-password}
POSTGRES_DB: ${POSTGRES_DB:-coder}
networks:
coder:
ipv4_address: 172.23.0.3
volumes:
- database:/var/lib/postgresql/data
healthcheck:
test:
[
"CMD-SHELL",
"pg_isready -U ${POSTGRES_USER:-username} -d ${POSTGRES_DB:-coder}",
]
interval: 5s
timeout: 5s
retries: 5
restart: unless-stopped
version: "3.9"

networks:
coder:
external: false
ipam:
driver: default
config:
- subnet: 172.23.0.0/24

volumes:
database:
driver: local

services:
coder:
image: ghcr.io/coder/coder:latest
container_name: coder
user: coder:998
environment:
CODER_PG_CONNECTION_URL: "postgresql://${POSTGRES_USER:-username}:${POSTGRES_PASSWORD:-password}@database/${POSTGRES_DB:-coder}?sslmode=disable"
env_file:
- coder.env
networks:
coder:
ipv4_address: 172.23.0.2
volumes:
- /var/run/docker.sock:/var/run/docker.sock
depends_on:
database:
condition: service_healthy
restart: unless-stopped

database:
image: postgres:14.5-alpine
container_name: coder_db
environment:
POSTGRES_USER: ${POSTGRES_USER:-username}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-password}
POSTGRES_DB: ${POSTGRES_DB:-coder}
networks:
coder:
ipv4_address: 172.23.0.3
volumes:
- database:/var/lib/postgresql/data
healthcheck:
test:
[
"CMD-SHELL",
"pg_isready -U ${POSTGRES_USER:-username} -d ${POSTGRES_DB:-coder}",
]
interval: 5s
timeout: 5s
retries: 5
restart: unless-stopped
Sven
SvenOPβ€’2y ago
And that doesn't work of does work?
Phorcys
Phorcysβ€’2y ago
it does work
Sven
SvenOPβ€’2y ago
oh Lets try it πŸ˜„
Phorcys
Phorcysβ€’2y ago
you should try only adding CODER_EXPERIMENTAL=true i guess because that's the only thing changed but it shouldn't need that, i am honestly confused by this it's likely just in front of us too
Sven
SvenOPβ€’2y ago
Does it make a diffrents when you have enter's between your text?
Phorcys
Phorcysβ€’2y ago
nah
Sven
SvenOPβ€’2y ago
πŸ‘ And port 80 Does that make a diffrents?
Phorcys
Phorcysβ€’2y ago
not either and here are my logs
WARN: --address and -a are deprecated, please use --http-address and --tls-address insteadStarted HTTP listener at http://0.0.0.0:7080

View the Web UI: https://coder.example.com
2023-02-18 19:16:48.668 [WARN] (coderd) <./coderd/coderd.go:851> initExperiments --experimental is deprecated, use --experiments='*' instead
2023-02-18 19:16:57.337 [INFO] (coderd.update_checker) <./coderd/updatecheck/updatecheck.go:147> (*Checker).start time until next update check {"duration": "23h59m8.722039556s"}
WARN: --address and -a are deprecated, please use --http-address and --tls-address insteadStarted HTTP listener at http://0.0.0.0:7080

View the Web UI: https://coder.example.com
2023-02-18 19:16:48.668 [WARN] (coderd) <./coderd/coderd.go:851> initExperiments --experimental is deprecated, use --experiments='*' instead
2023-02-18 19:16:57.337 [INFO] (coderd.update_checker) <./coderd/updatecheck/updatecheck.go:147> (*Checker).start time until next update check {"duration": "23h59m8.722039556s"}
we basically have the same setup except some network-related differences but that can't be the cause of it
Sven
SvenOPβ€’2y ago
Maybe when we changed the PI to 119 in the docker-compose.yaml
Phorcys
Phorcysβ€’2y ago
nope because the port forward feature doesn't require docker to work
Sven
SvenOPβ€’2y ago
And you have used 3.9
Phorcys
Phorcysβ€’2y ago
otherwise your workspace wouldn't boot at all
Sven
SvenOPβ€’2y ago
docker version yeah your right
Phorcys
Phorcysβ€’2y ago
yeah no that's the same thing
Sven
SvenOPβ€’2y ago
okay
Phorcys
Phorcysβ€’2y ago
what's your coder version ? actually !! can you show me this page? https://dev.bijsven.nl/settings/deployment/network
Sven
SvenOPβ€’2y ago
No description
Phorcys
Phorcysβ€’2y ago
okay, now the general tab please
Sven
SvenOPβ€’2y ago
No description
Phorcys
Phorcysβ€’2y ago
HAH lol i can't with this
Sven
SvenOPβ€’2y ago
?
Phorcys
Phorcysβ€’2y ago
uuuh... it was that simple THAT SIMPLE really
Sven
SvenOPβ€’2y ago
????
Phorcys
Phorcysβ€’2y ago
CODER_WILDCARD_ACCESS_URL is wrong
Sven
SvenOPβ€’2y ago
?! whats wrong?
Phorcys
Phorcysβ€’2y ago
No description
Phorcys
Phorcysβ€’2y ago
sorry it's just very funny it was right there all that time
Sven
SvenOPβ€’2y ago
No description
Sven
SvenOPβ€’2y ago
Thats what i have now
Phorcys
Phorcysβ€’2y ago
aggghhhhhh..... coder still doesn't know about it though clearly oh my god it's my fault entirely my fault i'm so so dumb
Sven
SvenOPβ€’2y ago
No your aren't
Phorcys
Phorcysβ€’2y ago
rename that .env to coder.env
Sven
SvenOPβ€’2y ago
What i send in dm πŸ˜›
Phorcys
Phorcysβ€’2y ago
and
Sven
SvenOPβ€’2y ago
and?
Phorcys
Phorcysβ€’2y ago
can you send your compose file again you need to get rid of the
environment:

environment:

block and replace it with
env_file: coder.env
env_file: coder.env
oh my god i really hate myself
Phorcys
Phorcysβ€’2y ago
all that time the variables just weren't being passed to the container can you wrap it in a codeblock next time pls
version: "3.8"

services:
coder:
# This MUST be stable for our documentation and
# other automations.
image: ghcr.io/coder/coder:${CODER_VERSION:-latest}
ports:
- "7080:7080"
environment:
CODER_PG_CONNECTION_URL: "postgresql://${POSTGRES_USER:-username}:${POSTGRES_PASSWORD:-password}@database/${POSTGRES_DB:-coder}?sslmode=disable"
env_file: coder.env
# If the coder user does not have write permissions on
# the docker socket, you can uncomment the following
# lines and set the group ID to one that has write
# permissions on the docker socket.
user: coder:119
volumes:
- /var/run/docker.sock:/var/run/docker.sock
depends_on:
database:
condition: service_healthy
database:
image: "postgres:14.2"
ports:
- "5432:5432"
environment:
POSTGRES_USER: ${POSTGRES_USER:-username} # The PostgreSQL user (useful to connect to the database)
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-password} # The PostgreSQL password (useful to connect to the database)
POSTGRES_DB: ${POSTGRES_DB:-coder} # The PostgreSQL default database (automatically created at first launch)
volumes:
- coder_data:/var/lib/postgresql/data # Use "docker volume rm coder_coder_data" to reset Coder
healthcheck:
test:
[
"CMD-SHELL",
"pg_isready -U ${POSTGRES_USER:-username} -d ${POSTGRES_DB:-coder}",
]
interval: 5s
timeout: 5s
retries: 5
volumes:
coder_data:
version: "3.8"

services:
coder:
# This MUST be stable for our documentation and
# other automations.
image: ghcr.io/coder/coder:${CODER_VERSION:-latest}
ports:
- "7080:7080"
environment:
CODER_PG_CONNECTION_URL: "postgresql://${POSTGRES_USER:-username}:${POSTGRES_PASSWORD:-password}@database/${POSTGRES_DB:-coder}?sslmode=disable"
env_file: coder.env
# If the coder user does not have write permissions on
# the docker socket, you can uncomment the following
# lines and set the group ID to one that has write
# permissions on the docker socket.
user: coder:119
volumes:
- /var/run/docker.sock:/var/run/docker.sock
depends_on:
database:
condition: service_healthy
database:
image: "postgres:14.2"
ports:
- "5432:5432"
environment:
POSTGRES_USER: ${POSTGRES_USER:-username} # The PostgreSQL user (useful to connect to the database)
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-password} # The PostgreSQL password (useful to connect to the database)
POSTGRES_DB: ${POSTGRES_DB:-coder} # The PostgreSQL default database (automatically created at first launch)
volumes:
- coder_data:/var/lib/postgresql/data # Use "docker volume rm coder_coder_data" to reset Coder
healthcheck:
test:
[
"CMD-SHELL",
"pg_isready -U ${POSTGRES_USER:-username} -d ${POSTGRES_DB:-coder}",
]
interval: 5s
timeout: 5s
retries: 5
volumes:
coder_data:
here you go
Sven
SvenOPβ€’2y ago
copy paste?
Phorcys
Phorcysβ€’2y ago
yeah you'll want your files to be : .env
POSTGRES_PASSWORD=<some_random_string>
POSTGRES_PASSWORD=<some_random_string>
coder.env
CODER_ADDRESS="0.0.0.0:7080"

CODER_ACCESS_URL="https://dev.bijsven.nl"
CODER_WILDCARD_ACCESS_URL="*.dev.bijsven.nl"
CODER_ADDRESS="0.0.0.0:7080"

CODER_ACCESS_URL="https://dev.bijsven.nl"
CODER_WILDCARD_ACCESS_URL="*.dev.bijsven.nl"
Sven
SvenOPβ€’2y ago
yeah
Phorcys
Phorcysβ€’2y ago
oh man this is such a simple mistake
Sven
SvenOPβ€’2y ago
No description
Phorcys
Phorcysβ€’2y ago
yeaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaah
Sven
SvenOPβ€’2y ago
Set it on the website
Phorcys
Phorcysβ€’2y ago
so much time wasted
Sven
SvenOPβ€’2y ago
Haha I have a free dayh its just no problem πŸ˜„
Phorcys
Phorcysβ€’2y ago
you should have that one now
No description
Sven
SvenOPβ€’2y ago
Yeah and then?
Phorcys
Phorcysβ€’2y ago
yeah so do you know how to start up a dev server ? you can use a command like python3 -m http.server in the directory that contains the html files then use the port-forward feature to access the http server
Sven
SvenOPβ€’2y ago
ah okay Terminal --
Phorcys
Phorcysβ€’2y ago
(given you have python3 installed)
Sven
SvenOPβ€’2y ago
Im doing a fresh reinstall πŸ˜„ 1 sec Is this good?
Sven
SvenOPβ€’2y ago
No description
Phorcys
Phorcysβ€’2y ago
yup then you can access 8000 from the port forward button
Sven
SvenOPβ€’2y ago
https://8000--main--Workspace-Sven--Sven.dev.bijsven.nl doesn't work 😦 It is a HTML file
Phorcys
Phorcysβ€’2y ago
what does it show ?
Sven
SvenOPβ€’2y ago
Dutch: Firefox Error Page
No description
Phorcys
Phorcysβ€’2y ago
oh yeah you're missing a DNS record maybe hold on yup you'll want to create an A record in your cloudflare UI *.dev.bijsven.nl and make it point to your ip
Sven
SvenOPβ€’2y ago
*.dev.bijsven.nl right?
Phorcys
Phorcysβ€’2y ago
yeah
Sven
SvenOPβ€’2y ago
No description
Sven
SvenOPβ€’2y ago
Saved! Same error Or it taking a while before it update
Phorcys
Phorcysβ€’2y ago
nah, you need to configure nginx proxy manager too so that it reverse proxies *.dev.bijsven.nl to coder
Sven
SvenOPβ€’2y ago
πŸ‘
Sven
SvenOPβ€’2y ago
No description
Phorcys
Phorcysβ€’2y ago
should work now
Sven
SvenOPβ€’2y ago
Nope Its intressting...
Phorcys
Phorcysβ€’2y ago
show me
Sven
SvenOPβ€’2y ago
This give 404 not found https://6060--main--workspace-sven--sven.dev.bijsven.nl/ but the python3 page Just refused
Phorcys
Phorcysβ€’2y ago
so it works add /index.html at the end maybe
Sven
SvenOPβ€’2y ago
on port 6060
Phorcys
Phorcysβ€’2y ago
atleast your port-forward works now i'm going to bed
Sven
SvenOPβ€’2y ago
Sleep well!
Phorcys
Phorcysβ€’2y ago
ty
Sven
SvenOPβ€’2y ago
Its working now.... Everthing is working! Now only how to add users to workspaces and im done! When you have apache2 and the editor on /var/www/html its perfect! And when your restart a workspace its resets the apt-installs you have done Like Apache is gone
Sharp
Sharpβ€’2y ago
@Sven honestly, reading this thread you really need to learn how images and containers work if you don't want to have to ask questions all the time. For example the reason everything is gone is because by default containers don't save anything added to them. You need to add a "volume" I don't mean to be rude, if this is back and forth works for you that's great, but otherwise I'd look at a video like this;
Sharp
Sharpβ€’2y ago
Tech With Tim
YouTube
An Introduction To Docker For Beginners
Welcome back to another video! In this video I am going to be giving you an introduction to Docker and more specifically talk about the difference between Docker and virtual machines! The first part of this video is going to be very face paced where I just explain the fundamentals of Docker and then I will head over to the computer and do a walk...
Sharp
Sharpβ€’2y ago
Although to give props where props are due, I'm impressed you got through the process without knowing about docker 🫠
Sven
SvenOPβ€’2y ago
But Coder is like a docker-container host right?
Phorcys
Phorcysβ€’2y ago
alright so yes! because docker containers are non-persistant, by default, the docker-code-server template has a docker volume for /home/coder. a docker volume is basically a folder mount managed by docker (it ends up in /var/lib/docker/volumes basically, nothing will persist if you don't have a volume mounted at some specific directories but, I don't recommend persisting APT packages, that takes way too much space. so, what you want to do is edit the Dockerfile to install apache2 (and maybe configure it a bit) for you
Sven
SvenOPβ€’2y ago
Can you just have a template that automaticly have Apache2 installed?!
Phorcys
Phorcysβ€’2y ago
Coder relies on terraform, docker is only one of the providers. think of docker as a "runtime" for your workspaces, you could have those be pretty much anything (a proxmox VM, a google cloud/aws VPS, etc) of course
Sven
SvenOPβ€’2y ago
yeah! Is there any documentation for creating those templates?
Phorcys
Phorcysβ€’2y ago
you're using docker-code-server right?
Sven
SvenOPβ€’2y ago
Yeah docker-compose
Phorcys
Phorcysβ€’2y ago
templates running on AWS, etc? no like the template you use
Sven
SvenOPβ€’2y ago
code-server "Starters Templates" > "Develop code-server in Docker"
Phorcys
Phorcysβ€’2y ago
yeah
Sven
SvenOPβ€’2y ago
That do i use
Phorcys
Phorcysβ€’2y ago
do you have the template on your computer?
Sven
SvenOPβ€’2y ago
Nope, how do you download/make that?
Phorcys
Phorcysβ€’2y ago
alright do you have the coder cli installed on your workstation
Sven
SvenOPβ€’2y ago
I don't think so
Phorcys
Phorcysβ€’2y ago
windows?
Sven
SvenOPβ€’2y ago
Yeah, my VPS is on Ubuntu Server and my laptop on Windows 11 latest build
Phorcys
Phorcysβ€’2y ago
just the first 2 steps should be okay then run coder login https://dev.bijsven.nl and coder templates pull docker-code-server template.tar and extract that tar with 7zip or whatever
Sven
SvenOPβ€’2y ago
Resource not found or you don't have access to it (Im am going to eat. brb)
Phorcys
Phorcysβ€’2y ago
to what command?
Sven
SvenOPβ€’2y ago
coder templates pull docker-code-server template.tar But now i am away πŸ˜‰
Phorcys
Phorcysβ€’2y ago
maybe it's not named that then ooooh -- you have a space in your template name not sure how that's gonna go coder templates pull "Code Server" template.tar edit: this is only the display name so it couldn't work
Sven
SvenOPβ€’2y ago
Same error
Phorcys
Phorcysβ€’2y ago
what does coder templates list output ?
Sven
SvenOPβ€’2y ago
code-server Feb. 18 2023 1 active dev.
Phorcys
Phorcysβ€’2y ago
yeah then it's coder templates pull code-server template.tar
Sven
SvenOPβ€’2y ago
Got m Does this release also keep apache2 etc.?
Phorcys
Phorcysβ€’2y ago
what? i'm making you pull the template so you can edit it
Sven
SvenOPβ€’2y ago
oh im sorry
Phorcys
Phorcysβ€’2y ago
i won't be available for a bit but you should look into using a dockerfile with your template there's a template for that and you can look at kreuzwerker/docker docs
Sven
SvenOPβ€’2y ago
πŸ‘ Can you set RAM and CPU limits on a Workspace? And can you connect Coder to a other server like Back-end --> Viewer --> Proxy --> Web
Phorcys
Phorcysβ€’2y ago
yes, look at kreuzwerker/docker docs you declare those limits in the docker_container what do you mean
Sven
SvenOPβ€’2y ago
nevermind
Atif
Atifβ€’2y ago
yes when we use different templates, e.g aws template is actually connecting your aws hosted workspace to Coder. Similar for other cloud providers
Sven
SvenOPβ€’2y ago
πŸ‘ and this:
C:\Users\sven-\Downloads>coder templates pull code-server template.tar
Resource not found or you do not have access to this resource.
Run 'coder templates pull --help' for usage.

C:\Users\sven-\Downloads>
C:\Users\sven-\Downloads>coder templates pull code-server template.tar
Resource not found or you do not have access to this resource.
Run 'coder templates pull --help' for usage.

C:\Users\sven-\Downloads>
Atif
Atifβ€’2y ago
make sure you are logged in coder login and also, verify if the name of template is correct
Sven
SvenOPβ€’2y ago
Im logged in
C:\Users\sven-\Downloads>coder login cloud.orae.ga
Your browser has been opened to visit:

https://cloud.orae.ga/cli-auth

> Paste your token here:
> Welcome to Coder, Sven! You're authenticated.

C:\Users\sven-\Downloads>coder templates pull code-server template.tar
Resource not found or you do not have access to this resource.
Run 'coder templates pull --help' for usage.

C:\Users\sven-\Downloads>
C:\Users\sven-\Downloads>coder login cloud.orae.ga
Your browser has been opened to visit:

https://cloud.orae.ga/cli-auth

> Paste your token here:
> Welcome to Coder, Sven! You're authenticated.

C:\Users\sven-\Downloads>coder templates pull code-server template.tar
Resource not found or you do not have access to this resource.
Run 'coder templates pull --help' for usage.

C:\Users\sven-\Downloads>
Phorcys
Phorcysβ€’2y ago
@Sven can you create a new issue instead please? I don't really like mixing issues together, it makes stuff less understandable
Sven
SvenOPβ€’2y ago
Im sorry! 😦
Phorcys
Phorcysβ€’2y ago
please.. not in this channel
Want results from more Discord servers?
Add your server